Skip to content

Commit 017adb0

Browse files
committed
chore: bump quick-xml to v0.38.3
1 parent 4f15385 commit 017adb0

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ crate-type = ["cdylib"]
1010

1111
[dependencies]
1212
pyo3 = { version = "0.27.0", features = ["extension-module"] }
13-
quick-xml = "0.37.2"
13+
quick-xml = "0.38.3"
1414

1515
# https://ohadravid.github.io/posts/2023-03-rusty-python
1616
[profile.release]

src/html_parser.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,9 @@ pub fn transform(
154154
let mut reader = Reader::from_str(html);
155155
let reader_config = reader.config_mut();
156156
reader_config.check_end_names = config.check_end_names;
157+
// Allow bare & in HTML content (e.g. "Hello & Welcome" instead of requiring "Hello & Welcome")
158+
// This is needed for compatibility with HTML5 which is more lenient than strict XML
159+
reader_config.allow_dangling_amp = true;
157160

158161
// We transform the HTML by reading it and writing it simultaneously
159162
let mut writer = Writer::new(Cursor::new(Vec::new()));

0 commit comments

Comments
 (0)