Skip to content

Surprising behaviour when nesting ordered lists with two spaces #353

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

Closed
robbertbrak opened this issue Jul 8, 2016 · 3 comments
Closed
Assignees
Labels

Comments

@robbertbrak
Copy link

When I try create a nested ordered list with two space indent:

1. A
  1. B

it does not produce a nested list. Instead, both A and B are rendered at the same level.

<ol>
  <li>A</li>
  <li>B</li>
</ol>

It seems that the minimum indentation level is three spaces. While this makes sense in retrospect (after all, the first item starts after three characters), it took me a while to figure it out, as the documentation on this point is rather hard to understand. It doesn't help that Github itself seems to have no problems with two space indents, or even one space:

  1. A
    1. B

Perhaps the documentation could be clarified with a few examples? E.g. something like http://spec.commonmark.org/0.25/#example-270.

@gettalong gettalong self-assigned this Jul 8, 2016
@gettalong
Copy link
Owner

If you look at the syntax documentation for lists http://kramdown.gettalong.org/syntax.html#lists there are already examples and a very in-depth description of how list indentation works with kramdown - do you mean that there should be more examples?

And yes, kramdown works differently regarding the indentation but this is on purpose, so it is no surprise that Github's parser accepts your input.

@robbertbrak
Copy link
Author

Yes, I do think that more examples would clarify things. I especially think that it would help to:

  • add a few more examples of ordered lists (most current examples use unordered lists) and show what happens if the numbers get to multiple digits;
  • make the examples shorter and more to the point. Currently the examples are both example and explanation, which I find distracting. I find it much easier to read examples such as the one I provided above: 'this' input leads to 'that' output.

NB. The reason I was surprised that Github works differently, is that I was under the impression that Github itself also uses Kramdown (e.g., https://help.github.com/articles/updating-your-markdown-processor-to-kramdown/).

@gettalong
Copy link
Owner

I have updated the documentation and there are now some more examples regarding the list indentation. Will be online at kramdown.gettalong.org once the new version is released.

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

2 participants