|
|
@@ -177,7 +177,7 @@ exports.extractContent = function (el, asFragment) {
|
|
|
var rawContent
|
|
|
/* istanbul ignore if */
|
|
|
if (
|
|
|
- el.tagName === 'TEMPLATE' &&
|
|
|
+ exports.isTemplate(el) &&
|
|
|
el.content instanceof DocumentFragment
|
|
|
) {
|
|
|
el = el.content
|
|
|
@@ -193,3 +193,16 @@ exports.extractContent = function (el, asFragment) {
|
|
|
}
|
|
|
return rawContent
|
|
|
}
|
|
|
+
|
|
|
+/**
|
|
|
+ * Check if an element is a template tag.
|
|
|
+ * Note if the template appears inside an SVG its tagName
|
|
|
+ * will be in lowercase.
|
|
|
+ *
|
|
|
+ * @param {Element} el
|
|
|
+ */
|
|
|
+
|
|
|
+exports.isTemplate = function (el) {
|
|
|
+ return el.tagName &&
|
|
|
+ el.tagName.toLowerCase() === 'template'
|
|
|
+}
|