Skip to content

Commit

Permalink
Merge branch 'release/1.6.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
JiveDig committed Jan 19, 2024
2 parents 8c7483b + b538465 commit 3f1d454
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
4 changes: 4 additions & 0 deletions classes/class-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -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( "<div>$html</div>" );

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions mai-table-of-contents.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@
"install-path": "../yahnis-elsts/plugin-update-checker"
}
],
"dev": true,
"dev": false,
"dev-package-names": []
}
6 changes: 3 additions & 3 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 3f1d454

Please sign in to comment.