-
Hello! I recently inherited a project which relies on Parsedown to parse markdown documents. Currently the project is moving a lot of stuff to frontend and I'm considering making the markdown parsing to the frontend library (Svelte). For this I'm evaluating micromark and markdown-it. The project relies on some custom markdown rules, let's call them "legacy flavor". Based on the documentation for this, the best case is to use custom extensions. Example:
These are really close to how block quotes work in CommonMark so my idea was to start with the spoiler tag which closely resembles block quotes and gradually move forward to the "more advanced" rules. Unfortunately, I'm facing issues with the exit tag and to be honest the lack of resources on how to build block level extensions makes it a bit hard to figure things out. By reading the source code, I slowly make progress, but maybe someone from the community can give me a few tips. First I created a few types.
Then created an extension and constructor objects.
The rest matches Can someone provide any guidance about where should I look? Any useful example which might help me better understand the logic? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Beta Was this translation helpful? Give feedback.
I thinkI found the problem, I had to register a document extension.