mirror of
https://github.com/jackyzha0/quartz.git
synced 2025-12-27 14:54:05 -06:00
Decode the heading id from split link
If href contains encoded characters (such as í, č, or others), they won't match with the content (since they are not encoded there). The function `decodeURIComponent()` solves this, and makes it possible to use headings such as `# Oxidatívna fosforylácia`.
This commit is contained in:
parent
8ea1525df4
commit
fc35755045
@ -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…
Reference in New Issue
Block a user