Skip to content

Commit

Permalink
fix string escaping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
amwmedia committed Nov 17, 2016
1 parent f09e7fc commit 3fbbaaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const handlebars = require('handlebars');

module.exports = function (plop, config) {

Expand All @@ -24,7 +25,8 @@ module.exports = function (plop, config) {

const border = '==';
const padding = ' ';
return `${cfg.commentStart}${border}${padding}END ${text}${padding}${border}${cfg.commentEnd}`;
const out = `${cfg.commentStart}${border}${padding}END ${text}${padding}${border}${cfg.commentEnd}`;
return handlebars.SafeString(out);
});

function multiLineHeader(text) {
Expand All @@ -40,7 +42,7 @@ module.exports = function (plop, config) {
out += `${padding}${border}\n`;
out += `${repeat('=', longestLine + (border.length * 2) + (padding.length * 2) - cfg.commentEnd.length)}${cfg.commentEnd}`;

return out;
return new handlebars.SafeString(out);
}
};

Expand Down
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "plop-pack-fancy-comments",
"version": "0.2.0",
"version": "0.2.1",
"description": "A set of plop helpers that provide some fancy code commenting",
"main": "index.js",
"scripts": {
Expand All @@ -23,5 +23,8 @@
"homepage": "https://github.com/amwmedia/plop-pack-fancy-comments#readme",
"devDependencies": {
"chokidar-cli": "^1.2.0"
},
"dependencies": {
"handlebars": "^4.0.5"
}
}

0 comments on commit 3fbbaaa

Please sign in to comment.