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

Constistent output of lists in html output #219

Open
m-wim opened this issue Nov 30, 2017 · 1 comment
Open

Constistent output of lists in html output #219

m-wim opened this issue Nov 30, 2017 · 1 comment

Comments

@m-wim
Copy link

m-wim commented Nov 30, 2017

As QOwnNotes uses the hoedown library the issue pbek/QOwnNotes#799 might be here on the right place

Expected behaviour

If list items are separated by one or more blank lines the html output should show two separated lists (or perhaps only one)

* A
* B
* C

* D
* E
* F

should become

  • A
  • B
  • C

  • D
  • E
  • F

or

  • A
  • B
  • C
  • D
  • E
  • F

Actual behaviour

Somehow a <p> element is inserted into the <li> elements C D E F, so it looks like

  • A
  • B

  • C

  • D

  • E

  • F
@uranusjr
Copy link

uranusjr commented Dec 1, 2017

Well, the Markdown spec says when there’re linebreaks in a list item, the list should contain items like <li><p>...</p></li>, so the correct output should be

<ul>
 <li><p>A</p></li>
 <li><p>B</p></li>
 <li><p>C</p></li>
 <li><p>D</p></li>
 <li><p>E</p></li>
 <li><p>F</p></li>
</ul>

Hoedown does this because it renders output in one pass, instead of creating AST first and then render. This is much efficient, but also means when it sees the linebreak in the C line, it can’t go back and fix the previous items, resulting the current output. This is not fixable unless you rewrite the how thing, which is exactly what the develop branch is doing… but that is stalled.

As things currently stand, the only choices you have are either to accept this behaviour, or switch to another 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

2 participants