summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/tokenizer.rs5
-rw-r--r--tests/test_spans.rs2
3 files changed, 7 insertions, 3 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 13d3cf3..61d8138 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,7 +42,8 @@
* Fixed most error spans mistakenly being empty.
* Fixed some error spans being off-by-one
- (`eof-*`, `end-tag-with-trailing-solidus`).
+ (`eof-*`, `end-tag-with-trailing-solidus`,
+ `missing-semicolon-after-character-reference`).
### 0.5.0 - 2023-08-19
diff --git a/src/tokenizer.rs b/src/tokenizer.rs
index 871074e..f76cad8 100644
--- a/src/tokenizer.rs
+++ b/src/tokenizer.rs
@@ -184,7 +184,10 @@ impl<R: Reader + Position<O>, O: Offset, E: Emitter<O>> Tokenizer<R, O, E> {
| Error::EofInComment
| Error::EofInDoctype
| Error::EofInScriptHtmlCommentLikeText
- | Error::EofInTag => self.reader.position()..self.reader.position(),
+ | Error::EofInTag
+ | Error::MissingSemicolonAfterCharacterReference => {
+ self.reader.position()..self.reader.position()
+ }
_ => self.reader.position() - 1..self.reader.position(),
};
self.emitter.emit_error(error, span);
diff --git a/tests/test_spans.rs b/tests/test_spans.rs
index 560fe0e..0956f8e 100644
--- a/tests/test_spans.rs
+++ b/tests/test_spans.rs
@@ -249,7 +249,7 @@ fn error_char_ref_missing_semicolon() {
let html = "&not";
assert_snapshot!(annotate_errors(html), @r###"
&not
- ^ missing-semicolon-after-character-reference
+ ^ missing-semicolon-after-character-reference
"###);
}