Closed thernstig closed 2 years ago
Sorry, but the quote from Gruber's rules which is contained in our explanation...
each subsequent paragraph in a list item must be indented by either 4 spaces or one tab
... can only be interpreted one way by me. Nothing will persuade me otherwise. Gruber simply failed to follow his own rule in his implementation. I have not made that mistake and never will. End of discussion.
That said, you are free to implement your own behavior in an extension/fork/clone/whatever.
It is important for a plethora of reasons. The main reason is that some of the biggest Markdown formatters in the world follows Common-Mark.
Sorry, didn't see this the first time. That is a valid concern. However, I always ensure any documents I author are well formed (they pass when feed to a strict Markdown linter). A well formed document should always be indented using 4 spaces per level. As such a well formed document will always parse correctly in any Markdown or Commonmark parser. In other words, its a non-issue for me. It is also the only way to ensure consistent parsing across all non-Commonmark parsers as every one is slightly different in varying ways.
https://python-markdown.github.io/#differences states:
The syntax rules are based on John Gruber's initial spec. But John Gruber’s canonical description of Markdown’s syntax does not specify the syntax unambiguously. In fact, CommonMark explains this in a way that directly contradicts the above section saying:
Then what is Markdown.pl? We can read this quote from CommonMark:
With all this fact in place, it is clear that Python-Markdown's section about this being clear is in fact incorrect. And contradicts the spec even as defined by John Gruber, which Python-Markdown says it follows. John Gruber's own implementation does allow 2 indentations between sublists.
Why is all this important?
It is important for a plethora of reasons. The main reason is that some of the biggest Markdown formatters in the world follows Common-Mark. For example VS Code's extension markdownlint or Prettier (the worlds biggest code formatter) by use of remark. They both use 2 space indentation for sublists as default.
Now, Python-Markdown clearly states it does not follow Common-Mark, even though I believe that would have been the best opion. But as it follows John Gruber's spec, and John Gruber both states and implements 2 spaces as indentation, then I think this plugin should at least honor that.
Caveat
I have read previous discussion in issues about this, such as https://github.com/Python-Markdown/markdown/issues/3#issuecomment-63399983. But I find the explanation incorrect, as proven above. The explanation at https://github.com/Python-Markdown/markdown/issues/3#issuecomment-63399983 says "all other implementations contain a bug". Which I find untrue, and being the other way around.