Markdown to HTML. remarkable vs markedjs vs markdown-it
29 Jul '18
Summary
I went with markdown-it as it is easy to extend markdown-it and write custom extensions. I am not talking about how to write extensions yet but instead talking about my process that led me to pick markdown-it.
markdown-it vs Marked.js
I have various use cases where I want to use Markdown but need to extend it further beyond the default functionality. For example:
- write responsive emails in Markdown.
- autolink twitter/facebook/linkedin handles (same for youtube videos).
- custom components like using Bulma.css notifications
There isn't a good way to do that with Markdown so I was looking for a way to build extensions. So far, I hadn't paid much attention to how Markdown to HTML conversion happens as I had set this site up following a particular blog (see previous post). It turned out that I was using Marked.js and it is pretty popular (past 6 month download numbers: remarkable at 125K, markdown-it at 335k, remark at 440K and marked.js above 1M). However, it is not easy to extend and even if it is easy, I couldn't find any useful articles to demonstrates it. There were some open issues where folks had requested documentation/extensibility to support usecases like mine but no proper response so I thought of looking for other alternatives.
Based on documentation and examples that I found, I wanted to go with remarkable and infact, I had already switched this blog to use remarkable (commit) but while reading documentation for markdown-it, I saw a mention that:
markdown-it is the result of the decision of the authors who contributed to 99% of the Remarkable code to move to a project with the same authorship but new leadership ....
Which sort of indicates that at some point remarkable might go on life support and instead, I should use markdown-it. It was easy to switch to that from remarkable (commit).
If I didn't need custom extensions, I wouldn't have ventured into this. Besides some extension needs, my requirements are pretty simple: just me being the author and need to convert few markdown files. Given that, I don't have any fancy performance comparisons to say that one is better than the other. However, just from the extensibility perspective, I would go with markdown-it. I wish there was more comprehensive guide/comparison between frameworks so I didn't have to spend time evaluting it by trial/error and digging through open issues on github repo but I learned something so not going to complain much about it.
Anyways, on to writing custom extensions.