From ec36377b9f316741f1e4dc80585fac29777b8e5c Mon Sep 17 00:00:00 2001 From: James Campos Date: Sun, 2 Aug 2020 00:17:49 -0700 Subject: fix epub3 chapter titles --- src/epub.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/epub.rs') diff --git a/src/epub.rs b/src/epub.rs index 73f4e44..aba0568 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -238,7 +238,14 @@ fn epub3(doc: Document, nav: &mut HashMap) { .descendants() .filter(|n| n.has_tag_name("a")) .for_each(|n| { - let path = n.attribute("href").unwrap().to_string(); + // TODO see if we can work w/o nav + let path = n + .attribute("href") + .unwrap() + .split('#') + .next() + .unwrap() + .to_string(); let text = n .descendants() .filter(Node::is_text) -- cgit v1.2.3