14 lines
243 B
JavaScript
14 lines
243 B
JavaScript
|
'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);
|
||
|
};
|