Skip to content

Better error for invalid HTML #13331

@Rich-Harris

Description

@Rich-Harris

Describe the problem

If you have something like this...

<table><td>hello</td></table>

...you get a compile time error:

<td> is invalid inside <table>

That's absurd — a <td> is only valid inside <table>.

Describe the proposed solution

A better error would be something like this:

<td> must be the child of a <tr> element

When you update it accordingly...

<table><tr><td>hello</td></tr></table>

...the error would become this:

<tr> must be the child of a <thead>, <tbody> or <tfoot> element

Importance

nice to have

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions