aboutsummaryrefslogtreecommitdiffstats
path: root/src/epub.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/epub.rs')
-rw-r--r--src/epub.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/epub.rs b/src/epub.rs
index ab727b0..b9f7e73 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -66,7 +66,11 @@ impl Epub {
frag: Vec::new(),
};
render(body, &mut c);
- self.links.insert(path.to_string(), (self.chapters.len(), 0));
+ if c.text.is_empty() {
+ continue;
+ }
+ self.links
+ .insert(path.to_string(), (self.chapters.len(), 0));
for (id, pos) in c.frag.drain(..) {
let name = path.rsplit('/').next().unwrap();
let url = format!("{}#{}", name, id);
@@ -91,7 +95,8 @@ impl Epub {
self.rootdir = match path.rfind('/') {
Some(n) => &path[..=n],
None => "",
- }.to_string();
+ }
+ .to_string();
let mut manifest = HashMap::new();
let mut nav = HashMap::new();
let mut children = doc.root_element().children().filter(Node::is_element);