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

fix: void elements #10493

Merged
merged 3 commits into from
Mar 19, 2024
Merged

fix: void elements #10493

merged 3 commits into from
Mar 19, 2024

Conversation

firefoxic
Copy link
Contributor

@firefoxic firefoxic commented Mar 19, 2024

Changes

  • What does this change?
    HTML is not XML. It doesn't have self-closing tags, it has void element tags that don't need closing slashes.

    Generated void elements (e.g. link with path to style file) do not pass validation, which can be easily fixed by simply removing two characters.

  • FYI: https://jakearchibald.com/2023/against-self-closing-tags-in-html/

  • Before/after screenshots can help as well.
    Screenshot from 2024-03-19 16-14-53
    Screenshot from 2024-03-19 16-17-11

  • Don't forget a changeset! pnpm exec changeset
    I'm not sure, but I hope I did it right.

Testing

I tested this change in my astro-project — it fixed the validity of the markup.

Docs

Correcting the documentation is most likely not necessary.

HTML is not XML. It doesn't have self-closing tags, it has void element tags that don't need closing slashes.

Now generated void elements (e.g. link with path to style file) do not pass validation, which can be easily fixed by simply removing two characters.
Copy link

changeset-bot bot commented Mar 19, 2024

🦋 Changeset detected

Latest commit: 367f275

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

@github-actions github-actions bot added the pkg: astro Related to the core `astro` package (scope) label Mar 19, 2024
@firefoxic firefoxic changed the title Fix/void elements fix: void elements Mar 19, 2024
@lilnasy lilnasy merged commit e4a6462 into withastro:main Mar 19, 2024
4 checks passed
@astrobot-houston astrobot-houston mentioned this pull request Mar 19, 2024
@firefoxic firefoxic deleted the fix/void-elements branch March 19, 2024 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants