This is a bug found while tackling
All the HTML is escaped coming out of
core/modules/views/templates/views-view-fields.html.twig due to twig autoescaping template files.
Steps to see this in action:
- Setup a view to show fields.
- Copy views-view-fields.html.twig into bartik/templates (or your custom theme)
- Clear cache
The file is basically unusable by themes.
Workaround: print out everything using the
|raw twig filter. Not the best solution.
Quoting from comment #3 on #2348747:
OK, so after some chat with dawehner in IRC, This is what has been tried:
- Removed String::checkPlain() calls from FieldPluginBase::elementType(), FieldPluginBase::elementLabelType() and FieldPluginBase::elementWrapperType() -> core/modules/views/src/Plugin/views/field/FieldPluginBase.php.
- Removed String::checkPlain call on the label inside the template_preprocess_views_view_fields function in core/modules/views/views.theme.inc.
These changes did NOT have an effect apparently.