[beta7] Remove raw filter usage from nav_menu

Created on 6 April 2024, 8 months ago
Updated 6 May 2024, 7 months ago

Problem/Motivation

nav_menu component has a non-standard menu structure:

items:
  type: links
  label: Menu items
  description: "Full-height and lightweight navigation (including support for dropdowns). With an additional 'content' property containing extra_title, extra_description, extra_link"
  preview:
    - title: Library
      url: "#"
      content:
        extra_title: Editorialized title
        extra_description: Lorem <a href="#">ipsum</a> dolor sit <strong>amet</strong>, consectetur adipiscing elit. Morbi placerat gravida tortor id semper. Maecenas posuere et dolor nec feugiat. Suspendisse potenti.
        extra_link:
          url: "#"
          label: See the whole section

https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/...

It is too late to change it because we are now committed to avoid breaking changes.

However, its template use raw filter, which is forbidden in component templates:

<p class="fr-hidden fr-unhidden-lg">{{ parent.content.extra_description|raw }}</p>

https://git.drupalcode.org/project/ui_suite_dsfr/-/blob/1.0.x/templates/...

Proposed resolution

  1. Check why there is such a filter. Where and how this component is used?
  2. If necessary, fix the usage.
  3. Remove the filter
📌 Task
Status

Fixed

Version

1.0

Component

Code

Created by

🇫🇷France pdureau Paris

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