src/HtmlFormatter.php
private function fixLibXML( $html ) {
		// We don't include rules like '&#34;' => '&amp;quot;' because entities had already been
		// normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE!
		$replacements = [
			'&quot;' => '&amp;quot;',
			'&amp;' => '&amp;amp;',
			'&lt;' => '&amp;lt;',
			'&gt;' => '&amp;gt;',
		];
		$html = strtr( $html, $replacements );

		// Just in case the conversion in getDoc() above used named
		// entities that aren't known to html_entity_decode().
		$html = \mb_convert_encoding( $html, 'UTF-8', 'HTML-ENTITIES' );
		return $html;
	}
private function fixLibXML( $html ) {
		// We don't include rules like '&#34;' => '&amp;quot;' because entities had already been
		// normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE!
		$replacements = [
			'&quot;' => '&amp;quot;',
			'&amp;' => '&amp;amp;',
			'&lt;' => '&amp;lt;',
			'&gt;' => '&amp;gt;',
		];
		$html = strtr( $html, $replacements );

		// Just in case the conversion in getDoc() above used named
		// entities that aren't known to html_entity_decode().
		$html = \mb_convert_encoding( $html, 'UTF-8', 'HTML-ENTITIES' );
		return $html;
	}
private function fixLibXML ( $ html ) { // We don't include rules like '&#34;' => '&amp;quot;' because entities had already been // normalized by libxml. Using this function with input not sanitized by libxml is UNSAFE! $ replacements = [ '&quot;' => '&amp;quot;' , '&amp;' => '&amp;amp;' , '&lt;' => '&amp;lt;' , '&gt;' => '&amp;gt;' , ] ; $ html = strtr ( $ html , $ replacements ) ; // Just in case the conversion in getDoc() above used named // entities that aren't known to html_entity_decode(). $ html = \ mb_convert_encoding ( $ html , 'UTF-8' , 'HTML-ENTITIES' ) ; return $ html ; }
libxml in its usual pointlessness converts many chars to entities - this function
perfoms a reverse conversion
@param string $html
@return string
libxml in its usual pointlessness converts many chars to entities - this function perfoms a reverse conversion