Problem/Motivation
When using a text field in the Layout Builder, the HTML filter format is not passed to text_summary
, causing broken HTML to be outputted when the text field contains HTML (such as p
Steps to reproduce
- Add a long "lorem ipsum" paragraph to a text field in a node. The field should use "Full HTML" with HTML correction enabled.
- Add the text field to a Layout Builder page.
- Layout Builder configuration: select "Formatter" as "trimmed". Select "200" for the "Trimmed limit".
The expected output would be:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
The actual output is:
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Doing some debugging, it seems the format of the text field is not passed to text_summary($text, $format = NULL, $size = NULL)
, hence the text field content does not respect the HTML filter of the field.
Proposed resolution
Ensure all text fields pass the filter format, guaranteeing the text is processes correctly by text_summary
Remaining tasks
User interface changes
API changes
Data model changes
Release notes snippet