X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Ftidy%2FRemexCompatFormatter.php;h=abc98baab4b2d7e3410fe15535890ec6ac5c299d;hb=c13fee87d42bdd6fdf6764edb6f6475c14c27749;hp=c8a715b1834a143acf8f630bb5208c60a8e261e1;hpb=85ac1b5d7c7ca50a93f2d16639cdde2f46bc133e;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/tidy/RemexCompatFormatter.php b/includes/tidy/RemexCompatFormatter.php index c8a715b183..abc98baab4 100644 --- a/includes/tidy/RemexCompatFormatter.php +++ b/includes/tidy/RemexCompatFormatter.php @@ -18,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["&"] ); } @@ -40,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";