Extra element read more link rendered incorrectly when inside <p> tag

Created on 2 May 2024, 8 months ago
Updated 8 May 2024, 8 months ago

Problem/Motivation

When selecting 'Extra element' as implementation, the twig template is rendered incorrectly.

How template should be rendered (using a definition tag)

<dfn>
  <button>
    <p>
      <a>Read more link</a>
    </p>
  </button> 
</dfn>

How template is rendered when inside <p> tag:

<p>
  <dfn>
    <button>
    </button> 
  </dfn>
</p>
<p>
  <a>Read more link</a>
</p>

<p> tags cannot be nested, to the <p> from the template (onomasticon.html.twig) is rendered after the parent <p> has been closed (which is outside the <dfn><button> elements). This issue started to occur after updating to Drupal Core 10.2.

Steps to reproduce

  • Use Drupal Core 10.2 or higher
  • Install and enable onomoasticon
  • Configure a text format to use the onomasticon filter using 'Extra element' as implementation
  • Add a <p> tag with a term to a text field using the text format
  • Save the page and check HTML output.

Proposed resolution

Use another element inside the button (e.g. <span>).

🐛 Bug report
Status

Active

Version

2.2

Component

Code

Created by

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024