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
Nested list not indenting #148
Comments
Quoting the Markdown Syntax Documentation:
The doc doesn’t specify how “left margin” is defined in nested lists, so the behaviour is usually not well-defined for less than 4 space indents (tabs would be fine, on the other hand). I’ll discuss this with authors of Hoedown and see if improvements are possible, but would advise you to always use indents with tabs or four (or multiplication) spaces. |
After some discussion (see the referenced Hoedown issue above) we settled on the idea that you should use 4 spaces (or more) for indentation. So the 2-space indentation is malformed input, and we do not guarantee the output. I’ll close this as won't fix. The newly released Standard/Common/Whatever Markdown spec, however, has a looser constraint for this. Since Hoedown is set to follow that spec, and MacDown most likely follows Hoedown’s implementation, this will still be ”fixed” sometime in the future. You can follow relevant issues in Hoedown’s issue tracker if you’re interested. |
I don't know if it's appropriate that someone decides 4 spaces is better than 2. Markdown is a standard, and 2 spaces is the convention for indented lists. https://guides.github.com/features/mastering-markdown/ I'd really like to see this changed in MacDown. |
Well, truth is, Markdown is really not a standard, but just a set of conventions made up by John Gruber, and improvised upon which by many others. It’s only normal for implementations to make their own decisions. If you don’t like the decision, you can always develop your own Markdown parser (which is what Hoedown, CommonMark, and others do), and if your parser is better than the current one, MacDown can then make the switch to use it. This is how open source software works. |
This parser is one I see used everywhere. 63k downloads in just the past day! Sure enough, it handles multi-indented lists (with two spaces) without issue. Of course, ultimately the decision is up to you guys. Just thought I'd point it out as I've had troubles with this, editing README files on GitHub projects. |
I just want to share an opinion of one that this is an incredibly important behavior for a markdown renderer. Nested lists are extremely common in markdown. You can certainly argue a literal and semantic interpretation of a spec ("up to" 4 spaces) and you might be literally and semantically right. They are intuitively expecting this to be 3 levels.
Survey 100 people and I suspect 100 will agree. This is a deal-breaking bug. Obviously I'm not paying you for this software, and I assume most people aren't, so take it for what it's worth. But I assume you do this because you want to share an awesome, valuable tool... and if that's the case, ask some of your users. I'd be very, very, very, very, very surprised if anyone wants or appreciates its current behavior. |
@mstratman We are not going to implement this feature alone, but if you can help finding a proper CommonMark implementation, your problem is automatically solved. Please see #704 (comment). |
@mstratman FWIW, I've been using Visual Studio Code for editing Markdown files. Its MD preview feature is rock solid, not to mention VS Code is an overall amazing editor. |
With the following markdown, I'm not seeing the 2nd-level indenting on the 3rd list item:
I expect the 3rd list item should be indented another level.
The text was updated successfully, but these errors were encountered: