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

A list with empty lines extends into the next paragraph. #845

Open
snnz opened this issue Jan 3, 2025 · 1 comment
Open

A list with empty lines extends into the next paragraph. #845

snnz opened this issue Jan 3, 2025 · 1 comment

Comments

@snnz
Copy link
Contributor

snnz commented Jan 3, 2025

Noticed this while looking at the test samples in #839.

CommonMark spec states that a list item can begin with at most one blank line. Example 280 demonstrates this.

var result = Markdown.ToHtml("-\n\n  foo");

The result is:

<ul>
<li></li>
</ul>
<p>foo</p>

If one more empty item is added

var result = Markdown.ToHtml("-\n-\n\n  foo");

Everything is as expected again:

<ul>
<li></li>
<li></li>
</ul>
<p>foo</p>

But if a blank line is inserted between the items:

var result = Markdown.ToHtml("-\n\n-\n\n  foo");

The result is suddenly

<ul>
<li></li>
<li><p>foo</p></li>
</ul>

Isn't this strange?

@xoofx xoofx added the bug label Feb 2, 2025
@xoofx
Copy link
Owner

xoofx commented Feb 2, 2025

Repro here

Isn't this strange?

Yes, it's probably a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants