diff options
author | Martin Fischer <martin@push-f.com> | 2023-09-01 13:27:46 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2023-09-03 23:00:05 +0200 |
commit | 6556106154d7e7cbc7820f223b9baaf49a900449 (patch) | |
tree | 1778db5ce2665aa49afb68041f53b6ee07149916 /src/emitter.rs | |
parent | 0581e619867bde2374376265b24169b404187529 (diff) |
fix!: make set_self_closing encoding-independent
Diffstat (limited to 'src/emitter.rs')
-rw-r--r-- | src/emitter.rs | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/emitter.rs b/src/emitter.rs index bb12ca4..341d335 100644 --- a/src/emitter.rs +++ b/src/emitter.rs @@ -99,7 +99,7 @@ pub trait Emitter<O> { /// /// If the current token is an end tag, the emitter should emit the /// [`Error::EndTagWithTrailingSolidus`] error. - fn set_self_closing(&mut self, slash_offset: O); + fn set_self_closing(&mut self, slash_span: Range<O>); /// Assuming the _current token_ is a doctype, set its "force quirks" flag to true. /// @@ -339,7 +339,7 @@ impl<O: Offset> Emitter<O> for DefaultEmitter<O> { self.emit_token(Token::Doctype(doctype)); } - fn set_self_closing(&mut self, slash_offset: O) { + fn set_self_closing(&mut self, slash_span: Range<O>) { let tag = self.current_token.as_mut().unwrap(); match tag { Token::StartTag(StartTag { @@ -349,10 +349,7 @@ impl<O: Offset> Emitter<O> for DefaultEmitter<O> { *self_closing = true; } Token::EndTag(_) => { - self.emit_error( - Error::EndTagWithTrailingSolidus, - slash_offset..slash_offset + 1, - ); + self.emit_error(Error::EndTagWithTrailingSolidus, slash_span); } _ => { debug_assert!(false); |