Remove usage of 'raw' from default twig templates

Created on 15 August 2024, 3 months ago
Updated 20 September 2024, 2 months ago

Problem/Motivation

Some of the default twig templates in the /templates directory use the 'raw' filter.

According to Drupal documentation β†’ , the 'raw' filter should be 'avoided whenever possible'.

Proposed resolution

Modify templates in the /templates directory that are using the raw filter on variables to not use the raw filter on variables. :)

As an example, instead of:
{{ message|raw }}

do this:

{% set message_markup = [{'#markup': message|render}] %}
{{ message_markup }}
πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States tzura

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