diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/epub.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/epub.rs b/src/epub.rs index ff78918..fa88234 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -50,12 +50,11 @@ impl Epub { } fn get_chapters(&mut self, spine: Vec<(String, String)>) { for (title, path) in spine { - let xml = self.get_text(&format!("{}{}", self.rootdir, path)); - let opt = ParsingOptions { allow_dtd: true }; // https://github.com/RazrFalcon/roxmltree/issues/12 // UnknownEntityReference for HTML entities - let doc = Document::parse_with_options(&xml, opt) - .unwrap_or_else(|_| panic!("Could not parse path: {}", &path)); + let xml = self.get_text(&format!("{}{}", self.rootdir, path)); + let opt = ParsingOptions { allow_dtd: true }; + let doc = Document::parse_with_options(&xml, opt).unwrap(); let body = doc.root_element().last_element_child().unwrap(); let state = Attributes::default(); let mut c = Chapter { |