Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit a3d3017

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

File tree

Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-0
lines changed

‎src/utils.js

Copy file name to clipboardExpand all lines: src/utils.js
+5Lines changed: 5 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.