Break Tags Are Stripped on Specific Filters

Created on 27 November 2023, 12 months ago
Updated 1 December 2023, 12 months ago

Problem/Motivation

Some filter plugins appear to strip the closing slash off break (br) tags. This, in combination with the _filter_autop function causes extra break tags to be added to content.

Steps to reproduce

use Drupal\Component\Utility\Html;

$testString = <<<EOS
<p>XYZ Corporation<br />
Marketing Dept<br />
PO Box 1234<br />
Anytown, 0H 12345-1234</p>
EOS;

echo "before: ${testString}\n" . PHP_EOL;

echo "after: " . Html::serialize(Html::load($testString)) . PHP_EOL;

Expectation

Expected break tags to retain their XHTML-compliant structure post-filter.

πŸ› Bug report
Status

Closed: works as designed

Version

10.1 ✨

Component
FilterΒ  β†’

Last updated 3 days ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States tsquared212 Chicago, IL

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

Comments & Activities

  • Issue created by @tsquared212
  • Status changed to Closed: works as designed 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States tsquared212 Chicago, IL

    False alarm.

    The issue I discovered was in part due to an old patch.

    Sorry guys.

Production build 0.71.5 2024