@@ -941,19 +941,30 @@ module.exports = {
941
941
/**
942
942
* Check whether the given node is a custom component or not.
943
943
* @param {VElement } node The start tag node to check.
944
+ * @param {boolean } [ignoreElementNamespaces=false] If `true`, ignore element namespaces.
944
945
* @returns {boolean } `true` if the node is a custom component.
945
946
*/
946
- isCustomComponent ( node ) {
947
- return (
948
- ( this . isHtmlElementNode ( node ) &&
949
- ! this . isHtmlWellKnownElementName ( node . rawName ) ) ||
950
- ( this . isSvgElementNode ( node ) &&
951
- ! this . isSvgWellKnownElementName ( node . rawName ) ) ||
952
- ( this . isMathElementNode ( node ) &&
953
- ! this . isMathWellKnownElementName ( node . rawName ) ) ||
947
+ isCustomComponent ( node , ignoreElementNamespaces = false ) {
948
+ if (
954
949
hasAttribute ( node , 'is' ) ||
955
950
hasDirective ( node , 'bind' , 'is' ) ||
956
951
hasDirective ( node , 'is' )
952
+ ) {
953
+ return true
954
+ }
955
+
956
+ const isHtmlName = this . isHtmlWellKnownElementName ( node . rawName )
957
+ const isSvgName = this . isSvgWellKnownElementName ( node . rawName )
958
+ const isMathName = this . isMathWellKnownElementName ( node . rawName )
959
+
960
+ if ( ignoreElementNamespaces ) {
961
+ return ! isHtmlName && ! isSvgName && ! isMathName
962
+ }
963
+
964
+ return (
965
+ ( this . isHtmlElementNode ( node ) && ! isHtmlName ) ||
966
+ ( this . isSvgElementNode ( node ) && ! isSvgName ) ||
967
+ ( this . isMathElementNode ( node ) && ! isMathName )
957
968
)
958
969
} ,
959
970
0 commit comments