@@ -51,6 +51,7 @@ const { getScope } = require('./scope')
51
51
52
52
const HTML_ELEMENT_NAMES = new Set ( require ( './html-elements.json' ) )
53
53
const SVG_ELEMENT_NAMES = new Set ( require ( './svg-elements.json' ) )
54
+ const MATH_ELEMENT_NAMES = new Set ( require ( './math-elements.json' ) )
54
55
const VOID_ELEMENT_NAMES = new Set ( require ( './void-elements.json' ) )
55
56
const VUE2_BUILTIN_COMPONENT_NAMES = new Set (
56
57
require ( './vue2-builtin-components' )
@@ -948,6 +949,8 @@ module.exports = {
948
949
! this . isHtmlWellKnownElementName ( node . rawName ) ) ||
949
950
( this . isSvgElementNode ( node ) &&
950
951
! this . isSvgWellKnownElementName ( node . rawName ) ) ||
952
+ ( this . isMathElementNode ( node ) &&
953
+ ! this . isMathWellKnownElementName ( node . rawName ) ) ||
951
954
hasAttribute ( node , 'is' ) ||
952
955
hasDirective ( node , 'bind' , 'is' ) ||
953
956
hasDirective ( node , 'is' )
@@ -977,7 +980,7 @@ module.exports = {
977
980
* @param {VElement } node The node to check.
978
981
* @returns {boolean } `true` if the node is a MathML element.
979
982
*/
980
- isMathMLElementNode ( node ) {
983
+ isMathElementNode ( node ) {
981
984
return node . namespace === NS . MathML
982
985
} ,
983
986
@@ -999,6 +1002,15 @@ module.exports = {
999
1002
return SVG_ELEMENT_NAMES . has ( name )
1000
1003
} ,
1001
1004
1005
+ /**
1006
+ * Check whether the given name is a well-known MathML element or not.
1007
+ * @param {string } name The name to check.
1008
+ * @returns {boolean } `true` if the name is a well-known MathML element name.
1009
+ */
1010
+ isMathWellKnownElementName ( name ) {
1011
+ return MATH_ELEMENT_NAMES . has ( name )
1012
+ } ,
1013
+
1002
1014
/**
1003
1015
* Check whether the given name is a void element name or not.
1004
1016
* @param {string } name The name to check.
0 commit comments