summary refs log tree commit diff
path: root/pages/main/page.js
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2024-12-01 20:37:58 +0200
committerWlodekM <[email protected]>2024-12-01 20:37:58 +0200
commitfc76e4501d0f9db81cf1e5077d2487309acd7694 (patch)
treef8d8650cdb9d170945fe241647ee9c1bfa557718 /pages/main/page.js
parentf84e913cfc6773fea1f79c6d99ff6253715770dc (diff)
do stuff
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);