Skip to content

Commit

Permalink
Switched utf8 encoding like upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
derpaschi committed Sep 24, 2024
1 parent f1b3d69 commit 7fa6440
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/namespace.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ function add_anchor_attribute( string $html ): string {

libxml_use_internal_errors( true );
$dom = new \DOMDocument();
$dom->loadHTML( $html_wo_nbs, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );
$dom->loadHTML( '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . $html_wo_nbs, LIBXML_HTML_NOIMPLIED | LIBXML_HTML_NODEFDTD );

// use xpath to select the Heading html tags.
$xpath = new \DOMXPath( $dom );
Expand All @@ -432,7 +432,7 @@ function add_anchor_attribute( string $html ): string {
}

// Save the HTML changes.
$content = mb_convert_encoding( $dom->saveHTML( $dom->documentElement ), 'ISO-8859-1', 'UTF-8' ); //phpcs:ignore
$content = $dom->saveHTML( $dom->documentElement ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase

return $content;
}
Expand Down

0 comments on commit 7fa6440

Please sign in to comment.