Skip to content

Commit f9702b5

Browse files
committed
better fix
1 parent b0819b7 commit f9702b5

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

packages/svelte/src/compiler/phases/2-analyze/visitors/RegularElement.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ export function RegularElement(node, context) {
8686
(attribute) => attribute.type === 'SpreadAttribute'
8787
);
8888

89-
node.metadata.svg = is_svg(node.name);
89+
node.metadata.svg =
90+
is_svg(node.name) ||
91+
(node.name === 'a' &&
92+
context.path.some((n) => n.type === 'RegularElement' && n.name === 'svg'));
9093
node.metadata.mathml = is_mathml(node.name);
9194

9295
if (is_custom_element_node(node) && node.attributes.length > 0) {

packages/svelte/src/compiler/phases/3-transform/utils.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -347,11 +347,6 @@ export function infer_namespace(namespace, parent, nodes) {
347347
}
348348
}
349349

350-
// If we're already in a non-html namespace, continue using that
351-
if (namespace !== 'html') {
352-
return namespace;
353-
}
354-
355350
/** @type {Namespace | null} */
356351
let new_namespace = null;
357352

0 commit comments

Comments
 (0)