diff --git a/packages/svelte/src/compiler/phases/3-transform/utils.js b/packages/svelte/src/compiler/phases/3-transform/utils.js index 653b480aed..e6769d9a3b 100644 --- a/packages/svelte/src/compiler/phases/3-transform/utils.js +++ b/packages/svelte/src/compiler/phases/3-transform/utils.js @@ -225,14 +225,7 @@ export function infer_namespace(namespace, parent, nodes, path) { only_svg = false; break; } - } else if ( - (node.type === 'Text' && node.data.trim() !== '') || - (node.type === 'ExpressionTag' && - node.expression.type === 'Literal' && - typeof node.expression.value === 'string' && - node.expression.value.trim()) || - node.type === 'HtmlTag' - ) { + } else if (node.type !== 'ConstTag' && (node.type !== 'Text' || node.data.trim() !== '')) { only_svg = false; } }