aboutsummaryrefslogtreecommitdiffstats
path: root/src/epub.rs
diff options
context:
space:
mode:
authorJames Campos <james.r.campos@gmail.com>2020-08-02 00:17:49 -0700
committerJames Campos <james.r.campos@gmail.com>2020-08-02 00:17:49 -0700
commitec36377b9f316741f1e4dc80585fac29777b8e5c (patch)
treed04bda6e8653fab0e923e60c09949fa7d5539a79 /src/epub.rs
parent800bad0bd801a5a0a47fafdde0b02f0e9e453b5e (diff)
downloadbk-ec36377b9f316741f1e4dc80585fac29777b8e5c.tar.gz
fix epub3 chapter titles
Diffstat (limited to 'src/epub.rs')
-rw-r--r--src/epub.rs9
1 files changed, 8 insertions, 1 deletions
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<String, String>) {
.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)