Curious: why make something Typora specific? #2
Replies: 1 comment 5 replies
-
Thanks for asking ;)
I actually looked into some existing parsers to see if I can build typora parser on top of it. It turns out they don't provide enough expansibility for typora-flavoured markdown. Use marked.js as an example:
There's just a lot of small things I can't do with existing frameworks. I also looked into forking marked.js and adding these features, however it's basically 3000 lines of undocumented & extremely complex code. It'll probably take more time for me to understand its code than writing a parser on my own.
This is my first time writing a proper parser, I thought it would be challenging and fun :P (turns out it frys my brain) (also performance is not great) |
Beta Was this translation helpful? Give feedback.
-
The whole point of Markdown is to be generic. Writing something for Typora specifically seems to go against the grain.
Why not make a general purpose tool that works with CommonMark (Typora purports to be CommonMark compliant, at least as its goal), and then add those extensions that Typora adds (e.g. Mermaid diagrams embedded in code blocks)?
Also, did you implement your own Markdown parser from scratch? That seems odd. Why not use one of the many existing parsers out there? If your implementation has some unique features, you should publish it as a library!
Beta Was this translation helpful? Give feedback.
All reactions