Warnings when using this on HTML5 markup

Created on 14 March 2024, 4 months 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.69.0 2024