- Issue created by @John_B
When line breaks are included inside <li>
tags, unmatched closing </p>
tags are generated.
Reproduce steps:
1.Go to /admin/config/content/formats/full_html, Enable filter "Convert line breaks into HTML (i.e. < br > and < p >)" under section "Enabled filters"
2.Add below html to node's body field with text format "Full HTML" and save
<ul><li>Here is a list Item.</li>
<li>Here is another list item, this time containing a line break which is converted by the filter to a br tag.
This is some more text followed by two line breaks, which the filter converts to a p tag.
And now some more text.</li>
</ul>
Expect:
And now some more text.
What happened instead?
We're getting an extra </p>
tag as follows:
<ul>
<li>Here is a list Item.</li>
<li>Here is another list item, this time containing a line break which is converted by the filter to a br tag.<br />
Then some more text followed by two line breaks, which the filter converts to a p tag.</p>
<p>And now some more text.</li>
</ul>
Repeat the experiement with unclosed <li>
tags, and two unclosed <p>
tags are generated, as follows:
<ul>
<li>Here is a list Item.</p>
<li>Here is another list item, this time containing a line break which is converted by the filter to a br tag.<br />
This is some more text followed by two line breaks, which the filter converts to a p tag.</p>
<p>And now some more text.
</ul>
Needs work
11.0 🔥
The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.