🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Move to a commonmark compliant markdown parser #1835

Closed

Description

@noraj

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

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

  1. facelessuser commented on Jul 25, 2019

    @facelessuser
    Contributor

    Please read the code of conduct:: https://www.pypa.io/en/latest/code-of-conduct/.

    This is rude and disrespectful.

  2. noraj commented on Jul 25, 2019

    @noraj
    ContributorAuthor

    @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.

  3. facelessuser commented on Jul 25, 2019

    @facelessuser
    Contributor

    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.

  4. waylan commented on Jul 25, 2019

    @waylan
    Contributor

    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.

  5. lovelydinosaur commented on Jul 25, 2019

    @lovelydinosaur
    Collaborator
    • Not really a feasible proposal as things stand.
    • Yup I'm working away on a possible future version at the moment.
    • Yup, it'd mean that it's more feasible to switch out the markdown handling to a different candidate.
    • Nope, we probably wouldn't switch to CommonMark by default.
  6. craigphicks commented on Oct 20, 2020

    @craigphicks

    Description

    Move from python-markdown to a commonmark compliant markdown parser. ... 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.

    It isn't really that hard to replace python-markdown by simply preprocessing any or even all of the markdown content with HTML produced by a different parser before invoking mkdocs. The problem is that downstream processing, such as mkdocs-material, is not really independent of the choice of parser. With a different parser, the HTML would change in ways that break mkdocs-material and would require modifying the css. So for the maintainer(s) of mkdocs-material, I would guess that the stability of mkdocs is paramount, as it permits the development of mkdocs-material to 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.

  7. AshleyYakeley commented on Dec 27, 2022

    @AshleyYakeley

    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.

  8. AshleyYakeley commented on Aug 3, 2023

    @AshleyYakeley

    For anyone coming across this issue: if you prefer CommonMark, these are your options:

    • mkdocs-plugin-commonmark (May 2020), a plugin which patches out the renderer, works with mkdocs==1.4.3 but not 1.5.0
    • mkdocs-commonmark (Sept 2019), a fork of MkDocs, but it looks abandoned
    • mdBook, a MkDocs alternative which uses CommonMark
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions