Closed Lucas-C closed 1 month ago
Also, I have a question: how do you recommand to handle malformed Markdown?
Should a BlockToken
subclass raise an error in the read()
method?
Or would it better to try to produce a valid AST and just produce a warning, or a log line, describing the problem ?
Hi @Lucas-C, thanks for your message, I guess it would make @miyuchina happy, provided he still watches this project. :)
To your question, I think the common approach so far is to skip the "malformed markdown" and treat it as it would be a plain text instead - as it actually could be just a text. At least that is what I can see in the various examples in the CommonMark spec. But I would also say it also depends on the exact case we want to handle. So your suggestions could possibly be also valid, but I'm not just sure at the moment...
@Lucas-C thank you also for providing this example for a custom block token - I found it really helpful!
Perhaps it could be a good idea to add this example to the developer guide, so that there is one example for a span token and one for a block token?
Perhaps it could be a good idea to add this example to the developer guide, so that there is one example for a span token and one for a block token?
OK, so I think we can safely close this one now. :)
Hi!
I just want to report a happy user š
I have switched from using
markdown-it
(NodeJS) tomistletoe
, and I really love it.This morning, in 30min, I was able to quickly add support for
:::
block containers, in a similar fashion as markdown-it-container:Example Markdown content that can be processed by this parser:
The API of your library is really well crafted, and its excellent design makes it very easy to extend!
So I just wanted to say THANK YOU š