fix(assets): pdf page linking support. (#1025)
* github-slugger pdf workaround * Skip sluggifying on pdf file extension * Account for pdf files without anchor * Address feedback
This commit is contained in:
parent
0a2b52f618
commit
d75928ad5c
@ -168,6 +168,9 @@ export function resolveRelative(current: FullSlug, target: FullSlug | SimpleSlug
|
||||
|
||||
export function splitAnchor(link: string): [string, string] {
|
||||
let [fp, anchor] = link.split("#", 2)
|
||||
if (fp.endsWith(".pdf")) {
|
||||
return [fp, anchor === undefined ? "" : `#${anchor}`]
|
||||
}
|
||||
anchor = anchor === undefined ? "" : "#" + slugAnchor(anchor)
|
||||
return [fp, anchor]
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user