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

Empty line in unordered list makes all list items wrapped in paragraph #310

Open
flof opened this issue Jul 12, 2024 · 0 comments
Open

Empty line in unordered list makes all list items wrapped in paragraph #310

flof opened this issue Jul 12, 2024 · 0 comments

Comments

@flof
Copy link

flof commented Jul 12, 2024

Given this markdown:

- Item 1
- Item 2
- Item 3
- Item 4

If i convert this to HTML with the mdtohtml binary, the output is correctly:

<ul>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
<li>Item 4</li>
</ul>

But if i add an empty line to the list items, like this:

- Item 1
- Item 2

- Item 3
- Item 4

... all list items in the output are wrapped in <p> elements:

<ul>
<li><p>Item 1</p></li>

<li><p>Item 2</p></li>

<li><p>Item 3</p></li>

<li><p>Item 4</p></li>
</ul>

The additional paragraph element makes the rendered list ugly, because the list item bullet is not in the same line as the list item text.

I would expect, that the empty line is ignored or that a new <ul> is started.

Tested with github.com/gomarkdown/markdown v0.0.0-20230922112808-5421fefb8386. It is reproducible in the mdtohtml binary and in the library.

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

1 participant