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
- Enable twig.config debug: true in development.services.yml
- Set 'Convert line breaks into HTML' as the last filter
- Add any nested entity like Media Image into the formatted text
- 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
- ☑ Update
function _filter_autop()
- ☑ 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.