Ver Fonte

basic mathml support

Evan You há 10 anos atrás
pai
commit
1dab15508f
2 ficheiros alterados com 7 adições e 1 exclusões
  1. 2 1
      src/platforms/web/runtime/node-ops.js
  2. 5 0
      src/platforms/web/util.js

+ 2 - 1
src/platforms/web/runtime/node-ops.js

@@ -1,5 +1,6 @@
 export const namespaceMap = {
-  svg: 'http://www.w3.org/2000/svg'
+  svg: 'http://www.w3.org/2000/svg',
+  math: 'http://www.w3.org/1998/Math/MathML'
 }
 
 export function createElement (tagName) {

+ 5 - 0
src/platforms/web/util.js

@@ -34,6 +34,11 @@ export function getTagNamespace (tag) {
   if (isSVG(tag)) {
     return 'svg'
   }
+  // basic support for MathML
+  // note it doesn't support other MathML elements being component roots
+  if (tag === 'math') {
+    return 'math'
+  }
 }
 
 const unknownElementCache = Object.create(null)