By dawehner on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.0.x
Introduced in version:
8.0.0-beta16
Issue links:
Description:
In Drupal 7, !placeholder in t() or format_string() would result in the placeholder being used without alteration. In Drupal 8 we have enabled Twig auto-escape which means that doing this type of placeholdering is no longer supported as the result would not be safe for output as HTML.
Common usages of !placeholder in Drupal 7 and how to achieve it in Drupal 8:
- Add a url to an href - see :placeholder for URLs
- Generate plain text for use in non-HTML - see Output strategy
- Because the input cannot possible contain anything that needs to be escaped - just use
@placeholder
Impacts:
Module developers
Themers