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

Function isUnknownElement

static/vuejs/vue.js:4330–4353  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

isReservedTagFunction · 0.70

Tested by

no test coverage detected