filter_autop should ignore twig.config debug html comments

Created on 16 February 2024, 10 months ago
Updated 20 April 2024, 8 months ago

Problem/Motivation

In order for a local environment to properly match a live environment, FilterAutoP text format filter should ignore html comments added by twig debug and not add extra <p> tags.

Steps to reproduce

  1. Enable twig.config debug: true in development.services.yml
  2. Set 'Convert line breaks into HTML' as the last filter
  3. Add any nested entity like Media Image into the formatted text
  4. See extra p tags added

Proposed resolution

Ignore any line breaks within or directly around anything that starts with:

<!-- THEME DEBUG -->
...
<!-- BEGIN OUTPUT from '...' -->

Remaining tasks

  1. β˜‘ Update function _filter_autop()
  2. β˜‘ Add test coverage

User interface changes

None

API changes

None

Data model changes

None

Release notes snippet

'Convert line breaks into HTML' no longer adds additional paragraph tags when twig theme debugging is enabled.

πŸ› Bug report
Status

Fixed

Version

10.3 ✨

Component
FilterΒ  β†’

Last updated 2 days ago

No maintainer
Created by

πŸ‡¬πŸ‡§United Kingdom scott_euser

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