PlainTextOutput::renderFromHtml() could better handle spaces

Created on 5 July 2023, almost 2 years ago

Problem/Motivation

Many HTML tags add horizontal space or a line break between them when rendered.
PlainTextOutput::renderFromHtml() simply removes HTML tags but does not add spaces, which can lead to a result that is surprising for users.

Steps to reproduce

Call PlainTextOutput::renderFromHtml('<p>Foo</p><p>Bar</p>'); .
The result will be FooBar but it would make more sense to have Foo Bar.

We noticed this when using HTML fields as metatag tokens. Some sentences are joined together without a space between them.

Proposed resolution

The method could add a space between each tag before stripping the tags.

✨ Feature request
Status

Active

Version

9.5

Component
Render  →

Last updated 7 days ago

Created by

🇫🇷France prudloff Lille

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