Skip to content

Commit a123e12

Browse files
committed
Added new handlebars helper.
Whitespace.
1 parent e85a8c3 commit a123e12

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/helpers.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ var hljs = require('highlight.js'),
22
markdown = require('markdown-it')({
33
html: true,
44
highlight: function (code) {
5+
56
return hljs.highlight('javascript', code).value;
7+
68
}
79
});
810

@@ -28,4 +30,14 @@ module.exports = function (hbs) {
2830

2931
});
3032

33+
hbs.registerHelper('replace', function (string, match, replacement) {
34+
35+
if (string) {
36+
37+
return string.replace(match, replacement);
38+
39+
}
40+
41+
});
42+
3143
};

0 commit comments

Comments
 (0)