Commit 7967765 1 parent 56f17ce commit 7967765 Copy full SHA for 7967765
File tree 6 files changed +20
-7
lines changed
6 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 1
1
# Changelog
2
2
3
+ ## v1.1.1
4
+
5
+ ### Fixed
6
+
7
+ - Ensure that ` TagScanner::is_in_end_tag ` resets when changing parsers.
8
+
3
9
## v1.1.0
4
10
5
11
### Added
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " lol_html"
3
- version = " 1.1.0 "
3
+ version = " 1.1.1 "
4
4
authors = [" Ivan Nikulin <inikulin@cloudflare.com, ifaaan@gmail.com>" ]
5
5
license = " BSD-3-Clause"
6
6
description = " Streaming HTML rewriter/parser with CSS selector-based API"
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " lolhtml"
3
- version = " 1.1.0 "
3
+ version = " 1.1.1 "
4
4
authors = [" Ivan Nikulin <inikulin@cloudflare.com>" , " Joshua Nelson <jnelson@cloudflare.com>" ]
5
5
edition = " 2021"
6
6
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " lol-html-js-api"
3
- version = " 1.1.0 "
3
+ version = " 1.1.1 "
4
4
authors = [" Ivan Nikulin <inikulin@cloudflare.com>" ]
5
5
edition = " 2021"
6
6
Original file line number Diff line number Diff line change @@ -45,6 +45,10 @@ impl<S: TagHintSink> StateMachineActions for TagScanner<S> {
45
45
. try_apply_tree_builder_feedback ( )
46
46
. map_err ( ActionError :: from) ?;
47
47
48
+ let is_in_end_tag = self . is_in_end_tag ;
49
+
50
+ self . is_in_end_tag = false ;
51
+
48
52
if let Some ( unhandled_feedback) = unhandled_feedback {
49
53
return self . change_parser_directive (
50
54
tag_start,
@@ -54,7 +58,7 @@ impl<S: TagHintSink> StateMachineActions for TagScanner<S> {
54
58
}
55
59
56
60
match self
57
- . emit_tag_hint ( input)
61
+ . emit_tag_hint ( input, is_in_end_tag )
58
62
. map_err ( ActionError :: RewritingError ) ?
59
63
{
60
64
ParserDirective :: WherePossibleScanForTagsOnly => Ok ( ( ) ) ,
Original file line number Diff line number Diff line change @@ -79,7 +79,11 @@ impl<S: TagHintSink> TagScanner<S> {
79
79
}
80
80
}
81
81
82
- fn emit_tag_hint ( & mut self , input : & [ u8 ] ) -> Result < ParserDirective , RewritingError > {
82
+ fn emit_tag_hint (
83
+ & mut self ,
84
+ input : & [ u8 ] ,
85
+ is_in_end_tag : bool ,
86
+ ) -> Result < ParserDirective , RewritingError > {
83
87
let name_range = Range {
84
88
start : self . tag_name_start ,
85
89
end : self . pos ( ) ,
@@ -90,8 +94,7 @@ impl<S: TagHintSink> TagScanner<S> {
90
94
91
95
trace ! ( @output name) ;
92
96
93
- if self . is_in_end_tag {
94
- self . is_in_end_tag = false ;
97
+ if is_in_end_tag {
95
98
self . tag_hint_sink . handle_end_tag_hint ( name)
96
99
} else {
97
100
self . last_start_tag_name_hash = self . tag_name_hash ;
You can’t perform that action at this time.
0 commit comments