when rational discussion was still a possibility
Thomas Leitner
t_leitner at gmx.at
Sun Sep 7 02:42:34 EDT 2014
On 2014-09-06 21:24 -0700 John MacFarlane wrote:
> All of this presupposes that we don't have indented code on the first
> line. The problem is, by the rules above there's no *fixed* position
> for indented code in a list item, since it depends on the first line.
> So where should indented code go if it's in the first line? We settle
> that with a rule that indented code in the first line should be
> indented five spaces: one space after the list marker, and four
> spaces which can be thought of as the usual indentation for indented
> code.
>
> That's why you get the two spaces there.
kramdown does it like this (quoted from the syntax page):
"You can have any block-level element as first element in a list item.
However, as described above, the leading tabs or spaces of the line
with the list item marker are stripped away. This leads to a problem
when you want to have a code block as first element. The solution to
this problem is the following construct:
*⋅
⋅⋅⋅⋅⋅⋅⋅⋅This⋅is⋅a⋅code⋅block⋅(indentation⋅needs⋅to⋅be⋅4(1)+4(1)
⋅⋅⋅⋅⋅⋅⋅⋅spaces⋅(tabs)).
Note that the list marker needs to be followed with at least one space
or tab! Otherwise the line is not recognized as the start of a list
item but interpreted as a paragraph containing the list marker."
-- Thomas
More information about the Markdown-Discuss
mailing list