Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294871

Entity reference label formatter escapes safe markup

$
0
0

Problem/Motivation

The entity_reference_label field formatter always assigns the output of EntityInterface::label() to a #plain_text render element, even though it can return an instance of TranslatableMarkup which can contain safe markup.

Steps to reproduce

Override the label method in an entity class and make it return an instance of MarkupInterface. Render an entity of that class with the entity_reference_label field formatter. The markup will be escaped.

Proposed resolution

Don't escape markup if it's safe.


Viewing all articles
Browse latest Browse all 294871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>