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

Function isUnknownElement

static/vuejs/vue.esm.js:4334–4357  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

isReservedTagFunction · 0.70

Tested by

no test coverage detected