Skip to content

Commit

Permalink
account for foreign namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Apr 15, 2024
1 parent 5966d7b commit bc8232b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/svelte/src/compiler/phases/2-analyze/validation.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,8 +570,12 @@ const validation = {
}
}

const is_self_closing = context.state.analysis.source[node.end - 2] === '/';
if (is_self_closing && !VoidElements.includes(node.name) && !SVGElements.includes(node.name)) {
if (
context.state.analysis.source[node.end - 2] === '/' &&
context.state.options.namespace !== 'foreign' &&
!VoidElements.includes(node.name) &&
!SVGElements.includes(node.name)
) {
warn(
context.state.analysis.warnings,
node,
Expand Down

0 comments on commit bc8232b

Please sign in to comment.