Warnings when using this on HTML5 markup

Created on 14 March 2024, about 1 year ago

Followup to 🐛 Paragraph tags are not stripped if the p tag has attributes like dir=ltr or title Fixed

Problem/Motivation

By using DOMDocument::loadHTML(), we might raise a lot of warnings because it's not supporting HTML5 markup (as stated in the documentation comments). Drupal Core fixed this by relying on the HTML5-PHP library instead of directly using DOMDocument.

Steps to reproduce

  1. Configure this filter on a text format
  2. Allow source editing and allow any HTML5 tag (ie. <mark>)
  3. Create a content using the allowed tag
  4. Display the content

Proposed resolution

Use Drupal Core's HTML::load() instead of our custom DOMDocument implementation so people using Drupal 10.2.x won't have warnings anymore.

🐛 Bug report
Status

Needs review

Version

1.0

Component

Code

Created by

🇫🇷France duaelfr Montpellier, France

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