Skip to content

Commit

Permalink
fix meta panic
Browse files Browse the repository at this point in the history
  • Loading branch information
aeosynth committed Jul 12, 2020
1 parent d6ef41c commit 2637f03
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/epub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 2637f03

Please sign in to comment.