Skip to content

Conversation

@thebaer
Copy link

@thebaer thebaer commented Jul 2, 2021

Previously, with EXTENSION_HARD_LINE_BREAK enabled, <li>s would contain unnecessary <br />s at the end of each item. It was especially noticeable by the vertical space this left following an ordered or unordered list.

This fixes that by also stripping trailing <br />s from individual list items when this extension is enabled.

One shortcoming of this patch: it does not completely fix the issue in nested lists, as far as the markup goes -- but the visual issues are gone, at least. I can work on fully fixing the markup if there's interest in that.

Input:

* One
* Two

Paragraph
Previous ResultFixed Result
<ul>
<li>One<br /></li>
<li>Two<br />
<br /></li>
</ul>
 
<p>Paragraph</p>
<ul>
<li>One</li>
<li>Two</li>
</ul>
 
<p>Paragraph</p>

Previously, with EXTENSION_HARD_LINE_BREAK enabled, <li>s would contain unnecessary <br />s at the end of each item. It was especially noticeable by the vertical space this left at the end of an ordered or unordered list.

This fixes that by stripping trailing <br />s from individual list items while in the process of stripping trailing newlines.

One shortcoming of this patch: it does not fix the issue in *nested* lists.
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

Successfully merging this pull request may close these issues.

1 participant