Decode the heading id from split link (#214)

hugo
Pavol Komlos 2 years ago committed by GitHub
parent 8ea1525df4
commit 666ffebe90
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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)
}

Loading…
Cancel
Save