From d935e76c2bfed7325d63f01c86177a9753e7b810 Mon Sep 17 00:00:00 2001 From: Henry Date: Fri, 10 Jan 2025 23:03:33 -0800 Subject: [PATCH] fix regression preventing navdoc parsing --- pkg/parser/epub/parser.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkg/parser/epub/parser.go b/pkg/parser/epub/parser.go index 283f6d2..4dab06f 100644 --- a/pkg/parser/epub/parser.go +++ b/pkg/parser/epub/parser.go @@ -111,14 +111,13 @@ func parseNavigationData(packageDocument PackageDocument, fetcher fetcher.Fetche if ncxItem == nil { return } - ncxPath := packageDocument.Path.Resolve(ncxItem.Href) - n, nerr := fetcher.Get(manifest.Link{Href: manifest.NewHREF(ncxPath)}).ReadAsXML(map[string]string{ + n, nerr := fetcher.Get(manifest.Link{Href: manifest.NewHREF(ncxItem.Href)}).ReadAsXML(map[string]string{ NamespaceNCX: "ncx", }) if nerr != nil { return } - ret = ParseNCX(n, ncxPath) + ret = ParseNCX(n, ncxItem.Href) } else { var navItem *Item for _, v := range packageDocument.Manifest { @@ -135,15 +134,14 @@ func parseNavigationData(packageDocument PackageDocument, fetcher fetcher.Fetche if navItem == nil { return } - navPath := packageDocument.Path.Resolve(navItem.Href) - n, errx := fetcher.Get(manifest.Link{Href: manifest.NewHREF(navPath)}).ReadAsXML(map[string]string{ + n, errx := fetcher.Get(manifest.Link{Href: manifest.NewHREF(navItem.Href)}).ReadAsXML(map[string]string{ NamespaceXHTML: "html", NamespaceOPS: "epub", }) if errx != nil { return } - ret = ParseNavDoc(n, navPath) + ret = ParseNavDoc(n, navItem.Href) } return }