diff --git a/CHANGES.md b/CHANGES.md index 7d7f92d..8243233 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,8 @@ # Changelog +## 1.6.3 (1/19/24) +* Fixed: Encoded special characters were displaying on the front end in some configurations. + ## 1.6.2 (1/18/24) * Fixed: Remove unnecessary encoding in PHP's DOMDocument which was unintentionally encoding some special characters from non-English languages. diff --git a/classes/class-table-of-contents.php b/classes/class-table-of-contents.php index e466f42..3d83ede 100644 --- a/classes/class-table-of-contents.php +++ b/classes/class-table-of-contents.php @@ -281,6 +281,9 @@ function get_data() { // Set HTML content. $html = $this->content; + // Encode. + $html = mb_encode_numericentity( $html, [0x80, 0x10FFFF, 0, ~0], 'UTF-8' ); + // Load the content in the document HTML. $dom->loadHTML( "
$html
" ); @@ -354,6 +357,7 @@ function get_data() { if ( count( $data['matches'] ) >= $this->args['headings'] ) { // Store TOC in new content. $data['content'] = $dom->saveHTML(); + $data['content'] = mb_convert_encoding( $data['content'], 'UTF-8', 'HTML-ENTITIES' ); } // Not enough headings. else { diff --git a/mai-table-of-contents.php b/mai-table-of-contents.php index 3899013..8358abf 100644 --- a/mai-table-of-contents.php +++ b/mai-table-of-contents.php @@ -4,7 +4,7 @@ * Plugin Name: Mai Table of Contents * Plugin URI: https://bizbudding.com/mai-design-pack/ * Description: Automatically create a table of contents from headings in your posts. - * Version: 1.6.2 + * Version: 1.6.3 * * Author: BizBudding * Author URI: https://bizbudding.com @@ -92,7 +92,7 @@ public function __wakeup() { private function setup_constants() { // Plugin version. if ( ! defined( 'MAI_TABLE_OF_CONTENTS_VERSION' ) ) { - define( 'MAI_TABLE_OF_CONTENTS_VERSION', '1.6.2' ); + define( 'MAI_TABLE_OF_CONTENTS_VERSION', '1.6.3' ); } // Plugin Folder Path. diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 920024e..fc2280d 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -54,6 +54,6 @@ "install-path": "../yahnis-elsts/plugin-update-checker" } ], - "dev": true, + "dev": false, "dev-package-names": [] } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 3003e2b..3c055f2 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,17 +3,17 @@ 'name' => '__root__', 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '78d9e73d55064586975255ada2999d6fb406a580', + 'reference' => '050b3614b33ca9be5c8522661c678034f79c5a53', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), - 'dev' => true, + 'dev' => false, ), 'versions' => array( '__root__' => array( 'pretty_version' => 'dev-develop', 'version' => 'dev-develop', - 'reference' => '78d9e73d55064586975255ada2999d6fb406a580', + 'reference' => '050b3614b33ca9be5c8522661c678034f79c5a53', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),