Repository navigation
Description
Description
Move from python-markdown to a commonmark compliant markdown parser.
For python:
https://github.com/commonmark/commonmark-spec/wiki/list-of-commonmark-implementations#python
Why
To have standard and compatible markdown instead of weird behavior that must be fixed by dozens of plugins.
Why is CommonMark needed?
John Gruber’s canonical description of Markdown’s syntax does not specify the syntax unambiguously.
Because there is no unambiguous spec, implementations have diverged considerably over the last 10 years. As a result, users are often surprised to find that a document that renders one way on one system (say, a GitHub wiki) renders differently on another (say, converting to docbook using Pandoc). To make matters worse, because nothing in Markdown counts as a “syntax error,” the divergence often isn’t discovered right away.
There’s no standard test suite for Markdown; MDTest is the closest thing we have. The only way to resolve Markdown ambiguities and inconsistencies is Babelmark, which compares the output of 20+ implementations of Markdown against each other to see if a consensus emerges.
We propose a standard, unambiguous syntax specification for Markdown, along with a suite of comprehensive tests to validate Markdown implementations against this specification. We believe this is necessary, even essential, for the future of Markdown.
About python-markdown
- Will never be CommonMark compliant: CommonMark Python-Markdown/markdown#851
- Is rudely accepting only 4 space indentations (no tabs, no 2 spaces): Identation Python-Markdown/markdown#850 / https://python-markdown.github.io/#differences
- python-markdown implement such an unusable markdown syntax they even develop themselves some extension to be able to fix their own default behavior: https://python-markdown.github.io/extensions/
- Themes like the most used mkdocs-material is forced to implement PyMdown Extensions (https://squidfunk.github.io/mkdocs-material/extensions/pymdown/) to be able to have essential features like HTTP auto-link that are core of all markdown parsers.
Disclaimer
This core issue may be closed soon as @waylan is a core developer of python-markdown so he will probably accept to move away from it.
Activity
facelessuser commentedon Jul 25, 2019
Please read the code of conduct:: https://www.pypa.io/en/latest/code-of-conduct/.
This is rude and disrespectful.
noraj commentedon Jul 25, 2019
@facelessuser I'm sorry, I read it but I don't see which part is rude or disrespectful?
You think the disclaimer is a
Personal attacks? I will modify it so.facelessuser commentedon Jul 25, 2019
Tone coupled with slights to contributors. I understand you are frustrated with the direction of the project, but I would leave unnecessary comments about contributors out.
waylan commentedon Jul 25, 2019
For the record I don't have a problem with Commonmark itself, but I do have a problem with CommonMark calling itself "Markdown". At best it is a sister to Markdown or 'inspired by Markdown,' but it is not "Markdown." In fact the creator of Markdown specifically requested that CommonMark not call itself Markdown.
Why do I care about the difference? Because, by the Commonmark spec's own admission, it breaks some things clearly defined in the original Markdown rules. Those changes would break the documents of our users and would be a backward incompatible change. I realize GitHub made such a change, but there are some older documents out there that are broken and I find that unacceptable for MkDocs. Obviously, GitHub came to a different conclusion, which they are entitled to do. But that doesn't make it the right choice for MkDocs.
So if you want a tool which uses CommonMark, that's fine. However, MkDocs uses Markdown, not CommonMark. You will need to look elsewhere for a CommonMark based tool.
As an aside, @tomchristie posted this comment recently where he mentions his work on a tomchristie/mkdocs2. I haven't had an opportunity to take a close look, but at a glance I get the impression that he anticipates including an option to select a different markup language for documents. Personally, I have no need for such a feature, but it could certainly be useful to some users and a way to introduce Commonmark as an option for those who want it.
lovelydinosaur commentedon Jul 25, 2019
craigphicks commentedon Oct 20, 2020
It isn't really that hard to replace
python-markdownby simply preprocessing any or even all of the markdown content with HTML produced by a different parser before invokingmkdocs. The problem is that downstream processing, such asmkdocs-material, is not really independent of the choice of parser. With a different parser, the HTML would change in ways that breakmkdocs-materialand would require modifying the css. So for the maintainer(s) ofmkdocs-material, I would guess that the stability ofmkdocsis paramount, as it permits the development ofmkdocs-materialto focus on higher level features, rather than scrambling every time the earth shifts under its feet. Admonition: the brakes on change of mkdocs are a blessing to mkdocs-material and its end users.It's a free world and eventually a replacement of or port from mkdocs-material to an alternative based on a different upstream(s) may appear and rival popularity. In the meantime, everyday usability and reliability are real and practical priorities.
AshleyYakeley commentedon Dec 27, 2022
Obviously MkDocs already has prior commitment to legacy-Markdown.
But for projects with no such commitment, there isn't any reason to prefer legacy-Markdown over CommonMark, is there? I think the answer to this question matters for MkDocs too, in the long run.
Switch from mkdocs to mdbook
Switch from mkdocs to mdbook
Switch from mkdocs to mdbook
AshleyYakeley commentedon Aug 3, 2023
For anyone coming across this issue: if you prefer CommonMark, these are your options: