Skip to content

Fix excessive <br> tags in lists using break-on-newline extra (issue #394)#422

Merged
nicholasserra merged 2 commits intotrentm:masterfrom
Crozzers:fix-issue-394
Mar 25, 2022
Merged

Fix excessive <br> tags in lists using break-on-newline extra (issue #394)#422
nicholasserra merged 2 commits intotrentm:masterfrom
Crozzers:fix-issue-394

Conversation

@Crozzers
Copy link
Copy Markdown
Contributor

The break-on-newline extra uses a regexp to replace 0 or more spaces followed by a new line, with a <br /> tag.
This is a problem for <ul>, <ol> and mixed lists, where list items are defined on new lines.
Something like

- Item 1
    - Item 2

Could end up as:

<ul>
<li>Item 1<br />
<ul><br />
<li>Item 2</li><br />
</ul></li>
</ul>

image

The proposed fix replaces 0 or more spaces followed by a new line, but only if they are not followed by a ul, ol or li opening/closing tag.

@Crozzers Crozzers changed the title Fix excessive <br> tags in lists using break-on-newline extra (issue#394) Fix excessive <br> tags in lists using break-on-newline extra (issue #394) Mar 23, 2022
@nicholasserra
Copy link
Copy Markdown
Collaborator

Nice thank you

@nicholasserra nicholasserra merged commit d5917a7 into trentm:master Mar 25, 2022
@Crozzers Crozzers deleted the fix-issue-394 branch April 7, 2022 22:42
@Crozzers Crozzers mentioned this pull request Aug 9, 2022
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.

2 participants