Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Update index.js #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,14 @@ module.exports = function(options) {
treeAdapter.appendChild(docFragment, node);

var tpl = parse5.serialize(docFragment);
tpl = tpl.replace('<template>', '').replace('</template>', '');
tpl = tpl.replace('<template>', '');
}

tpl.split("\n").forEach(function(line){
if (line) contents.template.push(line.trim());
});

contents.template = contents.template.join("").toString().replace(/'/g, "&#39;");
contents.template = contents.template.join("").toString().replace(/(<\/template>)(?!.*\1)/, '').replace(/'/g, "\\'");
}

if (type === "script") {
Expand Down Expand Up @@ -231,4 +231,4 @@ module.exports = function(options) {

callback(null, file);
});
}
}