In my template message--mas-user-register--default.html.twig I have the following code :

<a href='{{ drupal_token('message:author:url', {message: message}) }}'>Bienvenue à {{ drupal_token('message:author:display-name', {message: message}) }}</a>

The name of the user is incorrectly displayed :

Lil'o'caps

He should be :

Lil'o'caps

How to display the name correctly ? Thank you.

This is a template of the Message module.

Comments

zenimagine created an issue. See original summary.

chi’s picture

Try raw filter and verify content of the tokens
https://twig.symfony.com/doc/1.x/filters/raw.html

zenimagine’s picture

It does not work and the problem only appears on the username

Deeksha B’s picture

Status: Active » Needs review

Hi
I have got same issue, So I did it in this way, Please try this once.
Example: {{ fieldname | striptags | raw }}

zenimagine’s picture

Status: Needs review » Fixed

@Deeksha B Super thanks it works

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.