This repository has been archived on 2018-10-12. You can view files and clone it, but cannot push or open issues or pull requests.
ProgBlog/app/helpers/render-markdown.js

14 lines
243 B
JavaScript
Raw Normal View History

2016-02-24 14:09:22 -05:00
'use strict';
const marked = require('marked');
const hlite = require('highlight.js');
module.exports = function (text) {
marked.setOptions({
highlight(code) {
return hlite.highlightAuto(code).value;
},
});
return marked(text);
};