html - Does CommonMark spec allows leading spaces before the list marker? -


is valid list in commonmark?

  1. foo      - bar      - baz   2. qux 

i concerned validity of 2 leading spaces before each list marker, i.e. 1., 2., etc. valid provide leading spaces before list marker?

i unable find in spec explicitly mentions okay have leading spaces before each list marker in commonmark spec @ http://spec.commonmark.org/0.27/.

but there many examples seem show leading spaces used before list marker. examples, see

but spec spell out valid put spaces before list markers. can find in spec spells out or @ least implies this?

the specific rule rule 4 of list items section (which starts right after example 246):

  1. indentation. if sequence of lines ls constitutes list item according rule #1, #2, or #3, result of indenting each line of ls 1-3 spaces (the same each line) constitutes list item same contents , attributes. if line empty, need not indented.

examples 247, 248 , 249 show one, 2 , 3 spaces respectively, if interpreted list items. finally, example 250 shows 4 spaces of indent resulting in code block.

of course rule indented blocks states (emphasis added):

an indented code block composed of 1 or more indented chunks separated blank lines. indented chunk sequence of non-blank lines, each indented four or more spaces. contents of code block literal contents of lines, including trailing line endings, minus 4 spaces of indentation.

therefore, less 4 spaces of indentation not code block. couple paragraphs later find following:

if there ambiguity between interpretation of indentation code block , indicating material belongs list item, list item interpretation takes precedence:

the example given shows nested list item indented 4 or more spaces. however, same example indents parent list item 2 spaces, rule apply both.

for comparison, original markdown rules explicitly stated:

list markers typically start @ left margin, may indented 3 spaces.

this concept has existed in markdown many years.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -