-
Notifications
You must be signed in to change notification settings - Fork 862
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prettier support #751
Comments
I consider this a bug and will never be convinced otherwise.
Those implementation also have a bug. As an side, I do not consider CommonMark to be Markdown (but a derivative). Therefore, it is not relevant to this discussion.
Great. Then you may implement your own extension which supports that syntax. Finally, all of these points have been discussed with more detail elsewhere. Therefore this is a duplicate. |
Also, just out of pure curiosity: What's the benefit of enforcing 4 spaces? Allow fewer spaces: Enforce 4 spaces: |
Cons of fewer spaces are:
|
Cool, thanks for the answer!
Yeah, backwards compatibility is important. 👍
Even the HTML standard has made changes after de facto usage in browsers. ¯\_(ツ)_/¯ Still, my question was what the benefit of 4 spaces was. Is there any? |
I can't honestly say there is a benefit to 4 spaces. It's just what the spec had said. And now with a history of support for this behavior, it is hard to break it now. This is a really a discussion of what is better as much as what the original spec indicated. That is generally the aim of Python Markdown, that and the ability to easily extend it to whatever you want. With that said, there is no reason you can't implement an extension to do as you desire. Even as a member of this team, I try not to push my personal preferred syntax, and instead keep it to my own 3rd party extensions. If you don't want to write your own extension, you may find that there is an extension for this already somewhere, I haven't looked. As an alternative to writing your own extension, I've seen people mitigate the "ugliness" by indenting their lists two spaces so everything lines up:
Anyways, there are options available. |
Thanks, I found an extension that works for me in one of the other 6 duplicates: https://github.com/radude/mdx_truly_sane_lists I've made a PR to mention it in the docs: #752 |
I know about #451 and about the following:
But not even the original markdown implementation follows that. Try pasting the following:
- one two
…in https://daringfireball.net/projects/markdown/dingus. Result:
And since then, CommonMark has gained popularity, and it allows fewer spaces:
And here’s the thing: Prettier can auto-format markdown, and it uses CommonMark spec. Which unfortunately means that it turns more 4 spaces into the more good-looking 2 spaces:
Prettier 1.14.3
Playground link
Input:
- one two
Output:
- one two
Which means that I cannot use Prettier to format markdown that will be parsed using this package :(
Would you be willing to reconsider this?
EDIT: This fixes the issue: https://github.com/radude/mdx_truly_sane_lists
The text was updated successfully, but these errors were encountered: