$('a.anchor').on('click', function(e) {
// Workaround for bad TOC markers.
- if (($this).closest('#toc').length) return;
+ if ($(this).closest('#toc').length) return;
+ if ($(this).closest('#wltoc').length) return;
e.preventDefault();
let sel = window.getSelection();
let range = document.createRange();
let $p = $(this).nextAll('.paragraph').first()
- range.selectNode($p[0]);
+ range.selectNodeContents($p[0]);
sel.addRange(range);
qbox.showForSelection(sel);