Skip to content

unrecognized-char-ref

Reports a named character reference in text (&name;) that HTML does not define. Numeric references and references in attribute values are not checked.

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.

Reported
<!DOCTYPE html>
<title>x</title>
<p>&foo; &amp; &copy; &#123;</p>
angular:
lint:
rules:
unrecognized-char-ref: warn # off, warn (default), error
html:
lint:
rules:
unrecognized-char-ref: warn # off, warn (default), error
svelte:
lint:
rules:
unrecognized-char-ref: warn # off, warn (default), error
vue:
lint:
rules:
unrecognized-char-ref: warn # off, warn (default), error

Enabled 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.

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