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 requires 4 spaces instead of 2 #451

Closed
davidshen84 opened this issue Jan 16, 2016 · 1 comment
Closed

Nested list requires 4 spaces instead of 2 #451

davidshen84 opened this issue Jan 16, 2016 · 1 comment

Comments

@davidshen84
Copy link

Most common Markdown editor uses 2 spaces as the indentation for nested list. But this library requires 4, and there's no way to configure this value.

Ex:

  • level 1
    • level 2

Would it be possible to change the nested list indentation to 2, or add a configuration value?

@waylan
Copy link
Member

waylan commented Jan 17, 2016

The documentation clearly states:

  • Indentation/Tab Length

    The syntax rules clearly state that when a list item consists of multiple paragraphs, "each subsequent paragraph in a list item must be indented by either 4 spaces or one tab" (emphasis added). However, many implementations do not enforce this rule and allow less than 4 spaces of indentation. The implementers of Python-Markdown consider it a bug to not enforce this rule.

    This applies to any block level elements nested in a list, including paragraphs, sub-lists, blockquotes, code blocks, etc. They must always be indented by at least four spaces (or one tab) for each level of nesting.

    In the event that one would prefer different behavior, tab_length can be set to whatever length is desired. Be warned however, as this will affect indentation for all aspects of the syntax (including root level code blocks).

Of course, if you would like different behavior, you are free to create your own extension which does whatever you want. I, however, have no interest in implementing a bug just to "match" other implementations.

@waylan waylan closed this as completed Jan 17, 2016
MXEBot pushed a commit to mirror/chromium that referenced this issue Apr 2, 2017
Upstream uses indents of 4 spaces by default [1], but gitiles uses
2 spaces [2].  Change md_browser to match.

[1]: Python-Markdown/markdown#451
[2]: https://gerrit.googlesource.com/gitiles/+/master/Documentation/markdown.md#Lists

R=dpranke@chromium.org
BUG=

Review-Url: https://codereview.chromium.org/2772173002
Cr-Commit-Position: refs/heads/master@{#461334}
@lydell lydell mentioned this issue Nov 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants