The filter "Convert line breaks into HTML (i.e. <br> and <p>)" generates duplicate br tags after a line ending in a break tag that doesn't exactly match <br />

Created on 26 September 2019, about 6 years ago
Updated 15 February 2024, almost 2 years ago

We want to have different behavior for br tag for different device, so we're using < br class='*' / > in our body text area.

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

<p>First Line<br />
Second Line<br class='second' />
Third line</p>

3.View the node page and check view source, will find a duplicated br tag after "< br class='second' >" tag

<p>Hello <br>
Second line<br class="second"><br>
Third line</p>

Expect:
Should render what we input and remove the extra < br > tag

<p>Hello <br>
Second line<br class="second">
Third line</p>

What happened instead?
We're getting an extra < br > tag after < br class='second' >

πŸ› Bug report
Status

Needs review

Version

11.0 πŸ”₯

Component
FilterΒ  β†’

Last updated 4 months ago

No maintainer
Created by

πŸ‡¨πŸ‡³China Jieyyal

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024