Skip to content

Commit 0534c87

Browse files
Mingundralley
authored andcommitted
Fix missing text events in some circumstances
Fixed (2): async-tokio (1): issue774 issues (1): issue774
1 parent 022441f commit 0534c87

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
- `TooLongDecimal`
2828
- `TooLongHexadecimal`
2929
- [#771]: Fixed `Attribute::unescape_value` which does not unescape predefined values since 0.32.0.
30+
- [#774]: Fixed regression since 0.33.0: `Text` event may be skipped in `read_event_into()`
31+
and `read_event_into_async()` in some circumstances.
3032

3133
### Misc Changes
3234

@@ -42,6 +44,7 @@
4244
[#771]: https://github.com/tafia/quick-xml/pull/771
4345
[#772]: https://github.com/tafia/quick-xml/pull/772
4446
[#773]: https://github.com/tafia/quick-xml/pull/773
47+
[#774]: https://github.com/tafia/quick-xml/issues/774
4548

4649

4750
## 0.34.0 -- 2024-06-25

src/reader/buffered_reader.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@ macro_rules! impl_buffered_source {
6969
};
7070

7171
match memchr::memchr(b'<', available) {
72-
Some(0) => {
72+
// Special handling is needed only on the first iteration.
73+
// On next iterations we already read something and should emit Text event
74+
Some(0) if read == 0 => {
7375
self $(.$reader)? .consume(1);
7476
*position += 1;
7577
return ReadTextResult::Markup(buf);

0 commit comments

Comments
 (0)