Skip to content

Commit c18cdaa

Browse files
committed
Added highlight.js support to markdown content.
1 parent 93f636b commit c18cdaa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lib/helpers.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ module.exports = function (hbs) {
1111

1212
hbs.registerHelper('markdown', function (block) {
1313

14-
return marked(block);
14+
return marked(block, {
15+
16+
highlight: function (code) {
17+
18+
return hljs.highlight('javascript', code).value;
19+
20+
}
21+
22+
});
1523

1624
});
1725

0 commit comments

Comments
 (0)