Skip to content
Snippets Groups Projects

Resolve #3381145 "Problem with encoding"

1 file
+ 4
4
Compare changes
  • Side-by-side
  • Inline
+ 4
4
@@ -476,8 +476,8 @@ function asciidoc_display_parse_bare_html($html, $options = array()) {
// Parsed output was not found in local storage or the cache, so we need
// to parse it.
$dom = new \DomDocument();
$dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8'));
$dom = new \DomDocument('1.0', 'UTF-8');
$dom->loadHTML($html);
// Read off the book title.
$elem = $dom->getElementById('asciidoc-display-book-title');
@@ -737,7 +737,7 @@ function _asciidoc_display_dom_element_to_html($elem) {
return '';
}
$doc = new \DOMDocument;
$doc = new \DOMDocument('1.0', 'UTF-8');
$cloned = $elem->cloneNode(TRUE);
$doc->appendChild($doc->importNode($cloned, TRUE));
$html = @$doc->saveHTML();
@@ -827,7 +827,7 @@ function _asciidoc_display_highlight_xml_once($node, $doc) {
$classes = array_filter(explode(' ', $class));
if (in_array('programlisting-php', $classes)) {
$newcode = _asciidoc_display_highlight_code($pre->nodeValue);
$newdoc = new \DOMDocument();
$newdoc = new \DOMDocument('1.0', 'UTF-8');
$newdoc->loadHTML($newcode);
$el = $newdoc->getElementsByTagName('code')->item(0);
$newnode = $doc->importNode($el, TRUE);
Loading