no-ambiguous-ampersand
What it does
Section titled “What it does”Reports an & in text that starts no character reference (a & b), and a raw < in text where it is not a syntax error, such as the Hugo shortcode {{<. A > is the rule no-raw-gt.
Why it matters
Section titled “Why it matters”A lone & renders as written, but it turns into a different character the day the text after it spells an entity, and some tools reject it.
To fix, write & for the & and < for the <.
Example
Section titled “Example”...<title>t</title>...<p>a > b & &</p><p>Ham & Shroom</p><p>one...<script>if (a > b) {}</script>...Configuration
Section titled “Configuration”angular: lint: rules: no-ambiguous-ampersand: warn # off (default), warn, errorhtml: lint: rules: no-ambiguous-ampersand: warn # off (default), warn, errorsvelte: lint: rules: no-ambiguous-ampersand: warn # off (default), warn, errorvue: lint: rules: no-ambiguous-ampersand: warn # off (default), warn, errorEnabled by the presets: html/html-validate-recommended.
Suppress one line with sudsy-disable-next-line no-ambiguous-ampersand 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-validate | no-raw-characters |
partial | a lone & is no-ambiguous-ampersand, a raw < the parser’s syntax-error; html-validate does not report a >; the relaxed option is not available |