Twig debug mode causes parse error in appendXML

Created on 29 November 2021, over 2 years ago
Updated 1 May 2024, about 2 months ago

Problem/Motivation

If Twig Debug mode is true in services.yml, glossify fails with the following error:

Warning: DOMDocumentFragment::appendXML(): Entity: line 4: parser error : Double hyphen within comment: in Drupal\glossify\GlossifyBase->parseTooltipMatch() (line 144 of modules/contrib/glossify/src/GlossifyBase.php).

This is due to the

<!-- TWIG DEBUG -->

comments added to the rendered abbreviation.

Steps to reproduce

  1. Set twig debug mode = true in services.yml
  2. Load a page with glossary content
  3. Notice the error

Proposed resolution

Strip comments from rendered glossary output.

πŸ› Bug report
Status

Needs review

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States draenen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024