shubform
Version:
Shubform is a static website generator
18 lines (17 loc) • 495 B
JavaScript
import hljs from "highlight.js";
import { Marked } from "marked";
import { markedHighlight } from "marked-highlight";
const marked = new Marked(markedHighlight({
emptyLangClass: "hljs",
langPrefix: "hljs language-",
highlight(code, lang, info) {
const language = hljs.getLanguage(lang) ? lang : "plaintext";
return hljs.highlight(code, { language }).value;
},
}));
marked.setOptions({
pedantic: false,
gfm: true,
breaks: false,
});
export { marked };