Skip to content

Commit e78083a

Browse files
committed
1
1 parent 1cf783e commit e78083a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

web/markdown.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,13 @@ function renderMarkdwon(markdownViewId, markdownFileURL) {
5050
function () {
5151
if (this.readyState == 4 && this.status == 200) {
5252
const markdown = this.responseText;
53+
54+
marked.setOptions({
55+
highlight: function (code, lang) {
56+
return hljs.highlightAuto(code, [lang]).value;
57+
}
58+
});
59+
5360
const html = marked.parse(markdown);
5461
document.getElementById(markdownViewId).innerHTML = html;
5562
}

0 commit comments

Comments
 (0)