]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix: improve namespace handling for SVG and MathML tags edison/feat/svgAndMathML 13703/head
authordaiwei <daiwei521@126.com>
Tue, 29 Jul 2025 01:45:45 +0000 (09:45 +0800)
committerdaiwei <daiwei521@126.com>
Tue, 29 Jul 2025 01:51:25 +0000 (09:51 +0800)
packages/compiler-dom/src/parserOptions.ts

index 7da13bf534d4d627e535f456859f991e799f8a35..5ee2f99fb327d4075f3dd7d2deada19bf3d6e605 100644 (file)
@@ -24,7 +24,7 @@ export const parserOptions: ParserOptions = {
     let ns = parent ? parent.ns : rootNamespace
     if (parent && ns === Namespaces.MATH_ML) {
       if (parent.tag === 'annotation-xml') {
-        if (tag === 'svg') {
+        if (isSVGTag(tag)) {
           return Namespaces.SVG
         }
         if (
@@ -57,10 +57,10 @@ export const parserOptions: ParserOptions = {
     }
 
     if (ns === Namespaces.HTML) {
-      if (tag === 'svg') {
+      if (isSVGTag(tag)) {
         return Namespaces.SVG
       }
-      if (tag === 'math') {
+      if (isMathMLTag(tag)) {
         return Namespaces.MATH_ML
       }
     }