-
Hi, I'm probably a bit dumb but after reading all the readmes of the ecosystem I'm still not understanding the architecture.
TLDR What libraries should I use if I want only mdast output with a way to hook (by extensions) to the tokenizer |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi, I highly recommend reading extending markdown on why you almost never want to start building custom things. Your example in particular of supporting Since you're using Svelte, you could also take a look at mdsvex. |
Beta Was this translation helpful? Give feedback.
-
So I doubt that this is what you want. Because you actually have HTML. And want to regex it. But regexing HTML is a bad idea. ASTs are better. So you probably want to do more complex things than what you ask. Looking at your question literally, you look for https://github.com/syntax-tree/mdast-util-from-markdown. But indeed, I’m thinking that we’ll have 5 back and forth question about how to best solve your problems and it’ll include |
Beta Was this translation helpful? Give feedback.
So I doubt that this is what you want. Because you actually have HTML. And want to regex it. But regexing HTML is a bad idea. ASTs are better. So you probably want to do more complex things than what you ask.
Looking at your question literally, you look for https://github.com/syntax-tree/mdast-util-from-markdown.
But indeed, I’m thinking that we’ll have 5 back and forth question about how to best solve your problems and it’ll include
rehype-raw
and AST transforms of the HTML in your markdown.