X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftidy%2FRemexCompatFormatter.php;h=abc98baab4b2d7e3410fe15535890ec6ac5c299d;hb=c13fee87d42bdd6fdf6764edb6f6475c14c27749;hp=3dc727bc89b55fcdb79231e79e814af84957a541;hpb=2ffff73a46c29cdad1cbf59063f4dd75debd3b4c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/tidy/RemexCompatFormatter.php b/includes/tidy/RemexCompatFormatter.php index 3dc727bc89..abc98baab4 100644 --- a/includes/tidy/RemexCompatFormatter.php +++ b/includes/tidy/RemexCompatFormatter.php @@ -5,7 +5,6 @@ namespace MediaWiki\Tidy; use RemexHtml\HTMLData; use RemexHtml\Serializer\HtmlFormatter; use RemexHtml\Serializer\SerializerNode; -use RemexHtml\Tokenizer\PlainAttributes; /** * @internal @@ -19,9 +18,9 @@ class RemexCompatFormatter extends HtmlFormatter { public function __construct( $options = [] ) { parent::__construct( $options ); - $this->attributeEscapes["\xc2\xa0"] = ' '; + $this->attributeEscapes["\u{00A0}"] = ' '; unset( $this->attributeEscapes["&"] ); - $this->textEscapes["\xc2\xa0"] = ' '; + $this->textEscapes["\u{00A0}"] = ' '; unset( $this->textEscapes["&"] ); } @@ -41,10 +40,10 @@ class RemexCompatFormatter extends HtmlFormatter { $name = $node->name; $attrs = $node->attrs; - if ( isset( self::$markedEmptyElements[$name] ) && $attrs->count() === 0 ) { - if ( strspn( $contents, "\t\n\f\r " ) === strlen( $contents ) ) { - return "<{$name} class=\"mw-empty-elt\">$contents"; - } + if ( isset( self::$markedEmptyElements[$name] ) && $attrs->count() === 0 + && strspn( $contents, "\t\n\f\r " ) === strlen( $contents ) + ) { + return "<{$name} class=\"mw-empty-elt\">$contents"; } $s = "<$name";