summary refs log tree commit diff
path: root/pages/main/page.js
diff options
context:
space:
mode:
Diffstat (limited to 'pages/main/page.js')
-rw-r--r--pages/main/page.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/pages/main/page.js b/pages/main/page.js
index f1d40f2..ebdaab2 100644
--- a/pages/main/page.js
+++ b/pages/main/page.js
@@ -5,7 +5,17 @@ import { openPopup } from "../../lib/popups.js";
 
 window.html = html // debug
 
-const md = markdwonits()
+const md = markdwonits({
+    highlight: function (str, lang) {
+        if (lang && hljs.getLanguage(lang)) {
+            try {
+                return hljs.highlight(str, { language: lang }).value;
+            } catch (__) {}
+        }
+    
+        return ''; // use external default escaping
+    }
+})
 
 async function fetchJSON(url, opts) {
     let resp = await fetch(url, opts);