mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-26 05:19:01 +00:00
Decode the heading id from split link (#214)
This commit is contained in:
parent
8ea1525df4
commit
666ffebe90
1 changed files with 1 additions and 1 deletions
|
@ -27,7 +27,7 @@ function initPopover(baseURL, useContextualBacklinks, renderLatex) {
|
||||||
let splitLink = li.href.split("#")
|
let splitLink = li.href.split("#")
|
||||||
let cleanedContent = removeMarkdown(linkDest.content)
|
let cleanedContent = removeMarkdown(linkDest.content)
|
||||||
if (splitLink.length > 1) {
|
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>")
|
let headingIndex = cleanedContent.toLowerCase().indexOf("<b>" + headingName + "</b>")
|
||||||
cleanedContent = cleanedContent.substring(headingIndex, cleanedContent.length)
|
cleanedContent = cleanedContent.substring(headingIndex, cleanedContent.length)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue