How can I add custom "tags" to mdast-util-from-markdown? #135
Replies: 2 comments
-
Welcome @alvarocastro! 👋 You can find an example of this in https://github.com/syntax-tree/mdast-util-math/#readme, which extends markdown with math syntax. |
Beta Was this translation helpful? Give feedback.
-
You might also be able to add them with https://github.com/syntax-tree/mdast-util-find-and-replace (or https://github.com/syntax-tree/hast-util-find-and-replace, if you care about HTML) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I need to parse markdown, but my markdown has some custom tags (or nodes? I don't know the proper name) which are
[%12345%]
for mentions (where the number is the user ID) and#text
(for hashtags).I would like to know if
mdast-util-from-markdown
can somehow be extended to add those custom tags and get them as custom defined nodes in the result. The same way**text**
ends up being abold
node.I'm open to use other libraries, I just need to parse markdown (with some custom tags) into some kind of AST to conveniently manipulate it later (format it into some other kind of AST for a WYSIWYG editor (TipTap / ProseMirror))
Beta Was this translation helpful? Give feedback.
All reactions