unrecognized-char-ref
Angular templatesHTMLVue / SvelteVue / Sveltecorrectnessno fixdefault: warnhtml/html-validate-standard
What it does
Section titled “What it does”Reports a named character reference in text (&name;) that HTML does not define. Numeric references and references in attribute values are not checked.
Why it matters
Section titled “Why it matters”The browser shows the text as written, &foo;, which was not meant; it is usually a typo of an entity.
To fix, correct the name, or write & before it if the text is meant.
Example
Section titled “Example”<!DOCTYPE html><title>x</title><p>&foo; & © {</p>Configuration
Section titled “Configuration”angular: lint: rules: unrecognized-char-ref: warn # off, warn (default), errorhtml: lint: rules: unrecognized-char-ref: warn # off, warn (default), errorsvelte: lint: rules: unrecognized-char-ref: warn # off, warn (default), errorvue: lint: rules: unrecognized-char-ref: warn # off, warn (default), errorEnabled by the presets: html/html-validate-standard.
Suppress one line with sudsy-disable-next-line unrecognized-char-ref in a comment of the file’s language.
Upstream equivalents
Section titled “Upstream equivalents”The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.
| Tool | Rule | Match | What differs |
|---|---|---|---|
| html-eslint | no-invalid-entity |
partial | named references in text only |
| html-validate | unrecognized-char-ref |
partial | named references in text only; a missing semicolon, ignoreCase and references in attribute values are not checked |