Skip to content

[FEATURE] New rule proposal: no-invalid-entity #351

Closed
@yeonjuan

Description

@yeonjuan

Is your feature request related to a problem? Please describe.
I'd like to propose a new rule called no-invalid-entity.
HTML allows the use of named and numeric character references (entities) such as  ,  , or  . However, it's easy to introduce typos like &nbsb; or malformed numeric references like &#zzzz;, which are silently ignored by browsers and can lead to rendering issues or confusion.

correct

<p>&lt; &gt; &amp; &nbsp; &#160; &#xA0;</p>

incorrect

<p>&nbsb;</p>        <!-- typo -->
<p>&unknown;</p>     <!-- undefined entity -->
<p>&#zzzz;</p>       <!-- invalid numeric reference -->

Additional context
https://html.spec.whatwg.org/entities.json

Metadata

Metadata

Labels

ODHack14OnlyDust Hackathon 14enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions