diff --git a/index.js b/index.js index 2b92b53..42681cb 100644 --- a/index.js +++ b/index.js @@ -146,7 +146,10 @@ module.exports = function(options) { treeAdapter.appendChild(docFragment, node); var tpl = parse5.serialize(docFragment); - tpl = tpl.replace('', ''); + + var lastTemplateCloseTagEntryIndex = tpl.lastIndexOf(''); + tpl = tpl.substring(0, lastTemplateCloseTagEntryIndex) + .replace('