File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -132,17 +132,18 @@ impl ReaderState {
132132 /// Wraps content of `buf` into the [`Event::End`] event. Does the check that
133133 /// end name matches the last opened start name if `self.check_end_names` is set.
134134 pub fn emit_end < ' b > ( & mut self , buf : & ' b [ u8 ] ) -> Result < Event < ' b > > {
135+ // Strip the `/` character. `content` contains data between `</` and `>`
136+ let content = & buf[ 1 ..] ;
135137 // XML standard permits whitespaces after the markup name in closing tags.
136138 // Let's strip them from the buffer before comparing tag names.
137139 let name = if self . trim_markup_names_in_closing_tags {
138- if let Some ( pos_end_name) = buf[ 1 ..] . iter ( ) . rposition ( |& b| !is_whitespace ( b) ) {
139- let ( name, _) = buf[ 1 ..] . split_at ( pos_end_name + 1 ) ;
140- name
140+ if let Some ( pos_end_name) = content. iter ( ) . rposition ( |& b| !is_whitespace ( b) ) {
141+ & content[ ..pos_end_name + 1 ]
141142 } else {
142- & buf [ 1 .. ]
143+ content
143144 }
144145 } else {
145- & buf [ 1 .. ]
146+ content
146147 } ;
147148
148149 let decoder = self . decoder ( ) ;
You can’t perform that action at this time.
0 commit comments