diff options
author | James Campos <james.r.campos@gmail.com> | 2021-01-04 15:56:34 -0800 |
---|---|---|
committer | James Campos <james.r.campos@gmail.com> | 2021-01-04 15:56:34 -0800 |
commit | 91647ca4c826d83210f54d29871d606b15e37c80 (patch) | |
tree | 9e0d99bf6aee4b4ef50f9f8bdb4797aa6116aae9 /src | |
parent | 94481d475f05ce12dde84c499f6f9a1be420df89 (diff) | |
download | bk-91647ca4c826d83210f54d29871d606b15e37c80.tar.gz |
tweak
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 { |