Closed (fixed)
Project:
UI Suite Bootstrap
Version:
5.1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Nov 2024 at 14:32 UTC
Updated:
27 Nov 2024 at 10:09 UTC
Jump to comment: Most recent
Comments
Comment #2
grimreaperWorkaround solution like putting the variables into a render array with markup does not work because some tags are escaped and it is not possible to list manually every possible tags:
When printing in the presenter template the column_content variable there is no problem.
If I setup a column_content variable with
{% set column_content = '<p>foo</p>' %}, no problem when passed into the component. When using the "set" on an "area" in twig, then we obtain a Twig/Markup object and not directly the generated HTML.The problem is in app/core/lib/Drupal/Core/Render/Renderer.php::ensureMarkupIsSafe:
This is where the escape comes from. But in SDC, the only place where plain_text is used is in app/core/lib/Drupal/Core/Render/Element/ComponentElement.php::generateComponentTemplate:
But when I put a breakpoint in this if statement, it is not triggered. So I wonder where the plain_text comes.
Comment #5
grimreaperMR ready for discussion.
Impossible to fix otherwise. To avoid the escape from the renderer service, I need to use a formattable (or markup) markup object, and it is not doable in Twig.
Comment #7
grimreaper