This bug affects custom Redactor <p> styles... Empty <p> and <br> tags that are NOT visible in Redactor html view somehow get injected into the code on the front-end page...
I found a sort of workaround using the retain inline styles settings in 'advanced' on the field in question (see screenshot at the bottom of this issue), but this will permit messy input in future! Not ideal when handing the site over to clients who will invariably paste in copy from all manner of sources!
Steps to reproduce
Add a custom <p> style in a redactor .json config... in this case:
Add text to a redactor field. In this example 'normal paragraphs come in fine
<div class="prose pt-5 hidden md:block">
<p><strong>Elsewhere in the FA Cup:</strong> In today’s other early kick-off, it’s scoreless at half-time in the match between League One side Walsall and their Premier League visitors Leicester City.</p>
<p class="interview2" style="padding-right:10rem;"><strong>Elsewhere in the FA Cup:</strong> In today’s other early kick-off, it’s scoreless at half-time in the match between League One side Walsall and their Premier League visitors Leicester City.</p>
</div>
apply our custom formatting to two or more paragraphs. Seems to work OK with ONE paragraph but with two we end up with unwanted <p> and <br> tags... which do NOT show in the Redactor html view...
<div class="prose pt-5 hidden md:block">
<p></p>
<p style="padding-right:10rem;"><strong>Elsewhere in the FA Cup:</strong> In today’s other early kick-off, it’s scoreless at half-time in the match between League One side Walsall and their Premier League visitors Leicester City.</p>
<br>
<p style="padding-right:10rem;"><strong>Elsewhere in the FA Cup:</strong> In today’s other early kick-off, it’s scoreless at half-time in the match between League One side Walsall and their Premier League visitors Leicester City.</p><br><p style="padding-right:10rem;"><strong>Elsewhere in the FA Cup:</strong> In today’s other early kick-off, it’s scoreless at half-time in the match between League One side Walsall and their Premier League visitors Leicester City.</p>
<p></p>
</div>
Additional info
Craft version: Craft CMS 3.7.63.1
PHP version: 8.1.1
Database driver & version: MySQL 5.7.34
Plugins & versions: Redactor 2.10.11 (I have tried Custom Styles Redactor plugin too, but it is not active on this config)
Description
This bug affects custom Redactor
<p>
styles... Empty<p>
and<br>
tags that are NOT visible in Redactor html view somehow get injected into the code on the front-end page...I found a sort of workaround using the retain inline styles settings in 'advanced' on the field in question (see screenshot at the bottom of this issue), but this will permit messy input in future! Not ideal when handing the site over to clients who will invariably paste in copy from all manner of sources!
Steps to reproduce
<p>
style in a redactor .json config... in this case:<p>
and<br>
tags... which do NOT show in the Redactor html view...Additional info