Temporary fix for non-Latin header texts
-
Hi.
This plugin will not process non-latin heading texts and therefore, it will leave an empty anchor ID.
Currently, I have managed to temporarily fix this by adding a random string for the anchor, if it was empty.
Modified file: extended-toc.php
Putting the below code after line 455:if (empty($anchor)) {$anchor = substr(str_shuffle(str_repeat('abcdefghijklmnopqrstuvwxyz', mt_rand(1,10))),1,10);}
So it will look like:
for( $i = 0; $i < count($matches); $i++ ) { /** get anchor and add to find and replace arrays **/ $anchor = $this->url_encode_anchor($matches[$i][0]); if (empty($anchor)) {$anchor = substr(str_shuffle(str_repeat('abcdefghijklmnopqrstuvwxyz', mt_rand(1,10))),1,10);} $find = $matches[$i][0]; $replace = str_replace( . . .
Hope this help.
- The topic ‘Temporary fix for non-Latin header texts’ is closed to new replies.