- Issue created by @codebymikey
- Merge request !13027Issue #3541869 by codebymikey: Trim Drupal markup safely → (Open) created by codebymikey
The updated
trim
filter has been added.The test-only patch pipeline also showcases the behaviour.
Running the trim filter against a piece of markup string unescapes it.
This is because the default trim
Twig filter only has special handling for \Twig\Markup
, whereas Drupal uses \Drupal\Component\Render\MarkupInterface
.
So support for safely trimming MarkupInterface
should also be supported.
1. Attempt to run the trim filter on a piece of safe markup like <p>content</p>
2. The content is now rendered as an escaped html markup: <p>content</p>
.
Reimplement the original trim
filter but with support for Drupal markups.
If the trim is a non-standard whitespace trim, then the markup will be considered unsafe.
Provide MR with tests.
N/A
The default trim
Twig filter will now be implemented in Drupal.
TBD
Active
11.0 🔥
render system
The updated trim
filter has been added.
The test-only patch pipeline also showcases the behaviour.