-
-
Notifications
You must be signed in to change notification settings - Fork 317
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
list item continuation line versus indented code block versus subsequent list #497
Comments
I agree that cmark's current behavior isn't supportable by Reasoning in Example 201 is (using periods to represent
is just a paragraph, because the So, the result of prepending
is a block quote with a paragraph inside, and so is its lazy abbreviation
That seems right to me still. Let's try parallel reasoning.
is just a paragraph "foo * bar", so
is a list item with this paragraph inside. Since
So this argues for an interpretation where |
Thanks for the feedback. It pleases me twice because this is exactly how MD4C sees it right now.
I don't know Cmark's internals to help in this regard. But I can say I was quite surprised to see that in Cmark, the continuation line works differently in list items and in blockquotes, as this example exhibits. In MD4C, the blockquotes and lists are mostly treated in quite a uniform way on the level of block start/end/nesting recognition. |
Perhaps related to this is the following example, with
<blockquote>
<pre><code>foo
</code></pre>
</blockquote>
<pre><code>* bar
</code></pre> The above is inspired by http://spec.commonmark.org/0.28/#example-199, and also the reasoning given in example 201. Where However, somewhat inconsistently:
<ol start="100">
<li>
<pre><code>foo
</code></pre>
</li>
</ol>
<ul>
<li>bar</li>
</ul> Again there is no paragraph being interrupted, (as It may be tempting to look at the following line in the spec to support this from
However, since this list item occurs adjacent to (and not nested inside) the ordered list, the unordered list in question has unambiguous indentation.
<pre><code>* bar
</code></pre> Is indented too far to be a list, leading to the question of why 4 spaces is sufficient only if there is a previous list? |
I think this is related.
The interpretation SHOULD be: <ol>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
</ol>
<pre><code>3. c
</code></pre> but the current spec has: <ol>
<li>
<p>a</p>
</li>
<li>
<p>b</p>
</li>
<li>
<p>c</p>
</li>
</ol> Here there's not even an issue about paragraph continuations, so this is a simpler case. |
(Note: This issue report is about disambiguation of the following snippet within context of current specification 0.28. There is also issue #495 discussing whether the future specification versions should be changed to interpret it as a nested list.)
How should this be interpreted?
Please note the 4 spaces of indentation in the 2nd line are important for the merit of the question.
Using some common sense I can see two possible interpretations, marked A and B below:
Interpretation A: List item continuation line
Rationale:
*
is not indented enough to start a nested list. And if there would be no*
on the 2nd line, it would be continuation line for sure as well. See also http://spec.commonmark.org/0.28/#example-201 which is in some way analogous to this interpretation.Interpretation B: An indented code block
Rationale: If we do not see the 2nd line as a continuation line, it has to start a new top-level block. Taking the principle of uniformity into account, the 2nd line should be then interpreted the same way as if there is no 1st line at all. And four spaces imply an indented code block.
Interpretation C: Subsequent list
CMark currently interprets it differently, as follows:
However I see that interpretation troublesome as it is imho clearly against the principle of uniformity as explained in interpretation B.
The text was updated successfully, but these errors were encountered: