Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Misleading closing tag optionality and nesting information in <h1>...<h1> example in readme #34

Closed
myfonj opened this issue Sep 16, 2024 · 0 comments

Comments

@myfonj
Copy link

myfonj commented Sep 16, 2024

superhtml/README.md

Lines 43 to 47 in 93a0fa9

This will still be reported as an error by SuperHTML because otherwise the following snippet would have to be considered correct (while it's most probably a typo):
```html
<h1>Title<h1>
```

h1's closing tag is not optional per spec, so telling that <h1>a<h1>b would have to be considered correct is misleading: no validator would consider such construct correct.
Spec defines the error recovery here through strict rules of what given element can and cannot contain, effectively preventing nesting so producing two sibling headings, but it's really just the error recovery.

Paragraphs and list items, on the other hand, do have optional closing tags, and it would be neat to finally have HTML language server that really reflects that and at least does not lie in DOM breadcrumbs (see: microsoft/vscode-html-languageservice#63). Marking <p>a<p>b as error is also misleading, but understandable, and definitely better than the misinterpretation VSC LS does. But again, real HTML parser conformance in HTML LS would be pretty much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant