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

Function isUnknownElement

static/vuejs/vue.common.js:4336–4359  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

isReservedTagFunction · 0.70

Tested by

no test coverage detected