From ce384b0cfc514f8fada8d3455375c24480855900 Mon Sep 17 00:00:00 2001
From: Pavel <30803291+pavel-markelov@users.noreply.github.com>
Date: Fri, 17 Nov 2017 00:31:37 +0300
Subject: [PATCH] Remove last in component's template
Fix issue #5
---
index.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
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('', '').replace('', '');
+
+ var lastTemplateCloseTagEntryIndex = tpl.lastIndexOf('');
+ tpl = tpl.substring(0, lastTemplateCloseTagEntryIndex)
+ .replace('', '');
}
tpl.split("\n").forEach(function(line){
@@ -231,4 +234,4 @@ module.exports = function(options) {
callback(null, file);
});
-}
\ No newline at end of file
+}