Errors occurs when TOC contains special chars
xiongchengqing opened this issue · comments
Xiong,Cheng-Qing commented
it occurs errors when TOC contains special chars. jQuery selector treats selector string which contains special chars (*
, -
, ^
, ?
, etc) as invalid syntax. When it comes to rich text headings like some SQL select * from user
VS select * from "user"
, the TOC anchor jumping will fail.
This is my solution for the issue.
ghost-theme-kaldorei/assets/js/index.js
Line 82 in 6bd2e63
change to below
var target = document.getElementById($(this).attr('href').split('#')[1]);
If anyone have a better solution, pls update it.
Robert Shaw commented
Thanks for fixed this bug.