diff --git a/public/js/extra.js b/public/js/extra.js index ed1470b..76e9563 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -846,11 +846,13 @@ const linkifyAnchors = (level, containingElement) => { let header = headers[i] if (header.getElementsByClassName('anchor').length === 0) { if (typeof header.id === 'undefined' || header.id === '') { - // to escape characters not allow in css and humanize + // to escape characters not allow in css and humanize const id = slugifyWithUTF8(getHeaderContent(header)) header.id = id } - header.insertBefore(anchorForId(header.id), header.firstChild) + if (!(typeof header.id === 'undefined' || header.id === '')) { + header.insertBefore(anchorForId(header.id), header.firstChild) + } } } } diff --git a/public/js/index.js b/public/js/index.js index 98c3b6d..a7f4df9 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -2786,6 +2786,7 @@ function updateViewInner () { renderTOC(ui.area.markdown) generateToc('ui-toc') generateToc('ui-toc-affix') + autoLinkify(ui.area.markdown) generateScrollspy() updateScrollspy() smoothHashScroll()