Decode the heading id from split link (#214)

This commit is contained in:
Pavol Komlos 2022-10-12 17:21:28 +02:00 committed by GitHub
parent fb963b8db9
commit bc81bd7e65

View File

@ -27,7 +27,7 @@ function initPopover(baseURL, useContextualBacklinks, renderLatex) {
let splitLink = li.href.split("#")
let cleanedContent = removeMarkdown(linkDest.content)
if (splitLink.length > 1) {
let headingName = splitLink[1].replace(/\-/g, " ")
let headingName = decodeURIComponent(splitLink[1]).replace(/\-/g, " ")
let headingIndex = cleanedContent.toLowerCase().indexOf("<b>" + headingName + "</b>")
cleanedContent = cleanedContent.substring(headingIndex, cleanedContent.length)
}