Considering migration to CommonMark from Python Markdown


I’ve been trying to find a JS-based Markdown processor that provides a feature set comparable to Python Markdown. I’ve looked through the CommonMark spec and don’t see the features I’d need to to make this happen.

Some of the features I use are:

Ability to add IDs, classes, etc, to arbitrary elements.
For example, in Python Markdown, this

# Header 1 {: id="header" class="header" }

would render to this

<h1 id="header class="header>Header 1</h1>

Include HTML inline with the Markdown
Python Markdown doesn’t parse inline HTML.

These are just two of the important features I use. I’ve had difficulty finding any JS implementation that is anywhere near as flexible as Python Markdown. I’m ok with changing my workflow a little, but I would need to maintain the same level of functionality for the most part.

Does CommonMark have comparable feature to what I mentioned? Or can they be added with extensions or whatnot?


~ Tom

1 Like

Have you tried markdown-it with attrs extension?

1 Like

I haven’t but that looks promising! Thanks!