From 91647ca4c826d83210f54d29871d606b15e37c80 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 4 Jan 2021 15:56:34 -0800 Subject: tweak --- src/epub.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src') 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 { -- cgit v1.2.3