summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/typst/src/loading/xml.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/crates/typst/src/loading/xml.rs b/crates/typst/src/loading/xml.rs
index 338b2f30..fde7d55a 100644
--- a/crates/typst/src/loading/xml.rs
+++ b/crates/typst/src/loading/xml.rs
@@ -1,4 +1,5 @@
use ecow::EcoString;
+use roxmltree::ParsingOptions;
use crate::diag::{format_xml_like_error, At, FileError, SourceResult};
use crate::engine::Engine;
@@ -80,8 +81,12 @@ impl xml {
let text = std::str::from_utf8(data.as_slice())
.map_err(FileError::from)
.at(span)?;
- let document =
- roxmltree::Document::parse(text).map_err(format_xml_error).at(span)?;
+ let document = roxmltree::Document::parse_with_options(
+ text,
+ ParsingOptions { allow_dtd: true, ..Default::default() },
+ )
+ .map_err(format_xml_error)
+ .at(span)?;
Ok(convert_xml(document.root()))
}
}