Skip to content

Commit

Permalink
fix(html): allow self closing on non-void elements (#10478)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Oct 15, 2022
1 parent f542727 commit 29292af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/vite/src/node/plugins/html.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,9 @@ function handleParseError(
// Accept duplicate attributes #9566
// The first attribute is used, browsers silently ignore duplicates
return
case 'non-void-html-element-start-tag-with-trailing-solidus':
// Allow self closing on non-void elements #10439
return
}
const parseError = {
loc: filePath,
Expand Down
3 changes: 3 additions & 0 deletions playground/html/valid.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
<!-- attr with prefix -->
<use xlink:href="/sprite.svg#svg"></use>
</svg>

<!-- allow self closing on non-void elements -->
<self-close-non-void />

0 comments on commit 29292af

Please sign in to comment.