-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add explicit tag nesting rules for <picture> and <button> elements #7798
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
Add explicit tag nesting rules for <picture> and <button> elements #7798
Conversation
🦋 Changeset detectedLatest commit: 321b52d The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'@qwik.dev/core': patch | ||
--- | ||
|
||
Add explicit tag nesting rules for <picture> and <button> elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add explicit tag nesting rules for <picture> and <button> elements | |
FIX: add explicit tag nesting rules for <picture> and <button> elements |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @tzdesign for your PR, I have one small feedback
oops the merge ignored the unresolved conversation because on the v2 branch it's not needed :( |
Description
This PR introduces dedicated tag nesting rules for
<picture>
and<button>
elements to improve HTML validation in the Qwik server-side renderer.Changes
TagNesting.PICTURE
andTagNesting.BUTTON
constants.allowedContent()
to describe valid children for<picture>
(<source>
,<img>
) and<button>
(phrasing content except interactive elements).isInPicture()
to restrict<picture>
children to valid HTML elements.isInButton()
to disallow nested interactive elements inside<button>
.isInPhrasing()
to route<picture>
and<button>
appropriately.Why
Previously,
<picture>
and<button>
elements were validated only under generic phrasing content rules. This allowed invalid nesting (e.g., interactive elements inside<button>
or unrelated tags inside<picture>
). By adding explicit states and validation logic, HTML output from Qwik will better comply with the HTML specification and prevent common markup mistakes.Benefits
<button>
.<picture>
allowed children.Checklist
pnpm change