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

Function isUnknownElement

static/vuejs/vue.runtime.js:4326–4349  ·  view source on GitHub ↗
(tag)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

isReservedTagFunction · 0.70

Tested by

no test coverage detected