diff options
author | WlodekM <[email protected]> | 2024-12-01 20:37:58 +0200 |
---|---|---|
committer | WlodekM <[email protected]> | 2024-12-01 20:37:58 +0200 |
commit | fc76e4501d0f9db81cf1e5077d2487309acd7694 (patch) | |
tree | f8d8650cdb9d170945fe241647ee9c1bfa557718 /pages/main | |
parent | f84e913cfc6773fea1f79c6d99ff6253715770dc (diff) |
do stuff
Diffstat (limited to 'pages/main')
-rw-r--r-- | pages/main/page.js | 12 |
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); |