Problem with JetTheme Automatic Table of Contents (Japanese Headings)
The heading "BBBB" jumps to the heading "AAAA" and then to NG.
The headings "testD" and "testF" also jump to the heading "testC" and NG.
"Cause."
This is because "single byte in UTF-8" remain unchanged in the ID of the jump destination, but "multi bytes in UTF-8" are replaced by _ (underscore).
Of course, Japanese is also part of "multi bytes in UTF-8".
[OK]AAAA:
https://ataruchi.blogspot.com/2021/12/test-toc.html#__
[NG]BBBB:
https://ataruchi.blogspot.com/2021/12/test-toc.html#__
[OK]testC:
https://ataruchi.blogspot.com/2021/12/test-toc.html#test_
[NG]testD:
https://ataruchi.blogspot.com/2021/12/test-toc.html#test_
[OK]testEEE: If the number of "multi-byte characters" is different, success.
https://ataruchi.blogspot.com/2021/12/test-toc.html#test__
[NG]testF:
https://ataruchi.blogspot.com/2021/12/test-toc.html#test_
_ (Underscore) is replaced by
JetTheme JavaScript(version 0.4.8)
this part of the above.
[B](/[^\w!?]/g,"_")[B](/__/g,"_")
If I inline the script and remove this, it works correctly.
AAAA
AAAA(multi bytes in UTF-8)
BBBB
BBBB(multi bytes in UTF-8)
testC
test(single byte in UTF-8) + C(multi bytes in UTF-8)
testD
test(single byte in UTF-8) + D(multi bytes in UTF-8)
testEEE
test(single byte in UTF-8) + EEE(multi bytes in UTF-8)
testF
test(single byte in UTF-8) + F(multi bytes in UTF-8)
最後まで読んでいただき、ありがとうございます。 また、お越しくださいませ。
// アタル