Add token_replace_plain filter

Created on 27 June 2024, 7 months ago
Updated 21 July 2024, 6 months ago

Problem/Motivation

When a token includes an & the token_replace filter uses the core \Drupal::token()->replace function which turns this into &amp ;
Give users a choice to use \Drupal::token()->replacePlain function by which the & will be displayed correctly.

Steps to reproduce

Replace a title with an & sign in it in twig by using the token_replace function
e.g. node.field_custom_title.value|token_replace

Proposed resolution

Make \Drupal::token()->replacePlain available to Twig Tweak filters

Remaining tasks

-

User interface changes

-

API changes

-

Data model changes

-

Feature request
Status

Needs work

Version

3.0

Component

Code

Created by

🇳🇱Netherlands undersound3

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024