Skip to content

Commit a3d3017

Browse files
committed
add support for native <template> tag
1 parent a86dd14 commit a3d3017

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/utils.js

+5
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ var utils = module.exports = {
166166
if (template.charAt(0) === '#') {
167167
var templateNode = document.getElementById(template.slice(1))
168168
if (!templateNode) return
169+
// if its a template tag and the browser supports it,
170+
// its content is already a document fragment!
171+
if (templateNode.tagName === 'TEMPLATE' && templateNode.content) {
172+
return templateNode.content
173+
}
169174
template = templateNode.innerHTML
170175
}
171176
var node = document.createElement('div'),

0 commit comments

Comments
 (0)