We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab45b21 commit a00e127Copy full SHA for a00e127
web/markdown.js
@@ -53,14 +53,21 @@ function renderMarkdwon(markdownViewId, markdownFileURL) {
53
if (this.readyState == 4 && this.status == 200) {
54
const markdown = this.responseText;
55
56
+
57
marked.setOptions({
58
highlight: function (code, lang) {
59
return hljs.highlightAuto(code, [lang]).value;
60
}
61
});
62
63
64
const html = marked.parse(markdown);
65
document.getElementById(markdownViewId).innerHTML = html;
66
67
68
+ document.querySelectorAll(`#${markdownViewId} pre code`).forEach((block) => {
69
+ hljs.highlightElement(block);
70
+ });
71
72
73
;
0 commit comments