aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/epub.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/epub.rs b/src/epub.rs
index b523c06..b5510c8 100644
--- a/src/epub.rs
+++ b/src/epub.rs
@@ -79,11 +79,13 @@ impl Epub {
meta_node
.children()
- .filter(|n| n.is_element() && n.tag_name().name() != "meta")
+ .filter(Node::is_element)
.for_each(|n| {
let name = n.tag_name().name();
- let text = n.text().unwrap();
- self.meta.push_str(&format!("{}: {}\n", name, text));
+ let text = n.text();
+ if text.is_some() && name != "meta" {
+ self.meta.push_str(&format!("{}: {}\n", name, text.unwrap()));
+ }
});
manifest_node
.children()