mirror of
https://github.com/gotson/komga.git
synced 2025-12-16 05:24:56 +01:00
parent
48e6eaf41d
commit
cd6b83d14d
1 changed files with 6 additions and 1 deletions
|
|
@ -21,7 +21,12 @@ fun Document.getManifest() =
|
|||
fun normalizeHref(
|
||||
opfDir: Path?,
|
||||
href: String,
|
||||
) = (opfDir?.resolve(href)?.normalize() ?: Paths.get(href)).invariantSeparatorsPathString
|
||||
): String {
|
||||
val anchor = href.substringAfterLast("#", "")
|
||||
val base = href.substringBeforeLast("#")
|
||||
val resolvedPath = (opfDir?.resolve(base)?.normalize() ?: Paths.get(base)).invariantSeparatorsPathString
|
||||
return resolvedPath + if (anchor.isNotBlank()) "#$anchor" else ""
|
||||
}
|
||||
|
||||
/**
|
||||
* Process an OPF document and extracts TOC entries
|
||||
|
|
|
|||
Loading…
Reference in a new issue