Skip to content
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

Closed
sgarrity opened this issue Sep 3, 2014 · 8 comments
Closed

Nested list not indenting #148

sgarrity opened this issue Sep 3, 2014 · 8 comments
Labels

Comments

@sgarrity
Copy link

sgarrity commented Sep 3, 2014

With the following markdown, I'm not seeing the 2nd-level indenting on the 3rd list item:

* Lorem Ipsum
  * Lorem Ipsum
    * Lorem Ipsum
  * Lorem Ipsum

I expect the 3rd list item should be indented another level.

screenshot 2014-09-03 19 56 04

@uranusjr
Copy link
Member

uranusjr commented Sep 4, 2014

Quoting the Markdown Syntax Documentation:

List markers typically start at the left margin, but may be indented by up to three spaces. List markers must be followed by one or more spaces or a tab.

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.

@uranusjr
Copy link
Member

uranusjr commented Sep 6, 2014

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.

@ffxsam
Copy link

ffxsam commented Mar 8, 2016

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.

@uranusjr
Copy link
Member

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.

@ffxsam
Copy link

ffxsam commented Mar 18, 2016

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.

@mstratman
Copy link

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.
But actual human beings aren't semantically following a markdown spec.

They are intuitively expecting this to be 3 levels.

* a
  *b
    *c

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.

@FranklinYu
Copy link
Member

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

@ffxsam
Copy link

ffxsam commented Jan 27, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants