MCPcopy Create free account
hub / github.com/TruthHun/BookStack / isUnknownElement

Function isUnknownElement

static/vuejs/vue.runtime.common.js:4332–4355  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

4330
4331var unknownElementCache = Object.create(null);
4332function isUnknownElement (tag) {
4333 /* istanbul ignore if */
4334 if (!inBrowser) {
4335 return true
4336 }
4337 if (isReservedTag(tag)) {
4338 return false
4339 }
4340 tag = tag.toLowerCase();
4341 /* istanbul ignore if */
4342 if (unknownElementCache[tag] != null) {
4343 return unknownElementCache[tag]
4344 }
4345 var el = document.createElement(tag);
4346 if (tag.indexOf('-') > -1) {
4347 // http://stackoverflow.com/a/28210364/1070244
4348 return (unknownElementCache[tag] = (
4349 el.constructor === window.HTMLUnknownElement ||
4350 el.constructor === window.HTMLElement
4351 ))
4352 } else {
4353 return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
4354 }
4355}
4356
4357/* */
4358

Callers

nothing calls this directly

Calls 1

isReservedTagFunction · 0.70

Tested by

no test coverage detected