Dough Git

commit

JPCL highlighting

commit
83fda6cf77e49b8690ee11845b5729d971d4e30b
author
Clove <[email protected]>
date
2026-11-25 00:50

diff --git a/deno.json b/deno.json
index 21b8ddd..ba2faef 100644
--- a/deno.json
+++ b/deno.json
@@ -20,6 +20,7 @@
     "@types/node": "npm:@types/node@^24.19.2",
     "@typescript/native-preview": "npm:@typescript/native-preview@^7.0.0-dev.20260707.2",
     "highlight.js": "npm:[email protected]",
+    "jpcl-lang": "npm:[email protected]",
     "openid-client": "npm:openid-client@^6.8.8",
     "svelte": "npm:svelte@^5.57.3",
     "svelte-check": "npm:svelte-check@^4.7.7",
diff --git a/deno.lock b/deno.lock
index 6a5bfbf..4e5ee43 100644
--- a/deno.lock
+++ b/deno.lock
@@ -8,6 +8,7 @@
     "npm:@types/node@^24.19.2": "24.19.2",
     "npm:@typescript/native-preview@^7.0.0-dev.20260707.2": "7.0.0-dev.20260707.2",
     "npm:[email protected]": "11.11.1",
+    "npm:[email protected]": "2.1.0",
     "npm:openid-client@^6.8.8": "6.9.0",
     "npm:svelte-check@^4.7.7": "[email protected][email protected]",
     "npm:svelte@^5.57.3": "5.58.0",
@@ -394,6 +395,10 @@
     "[email protected]": {
       "integrity": "sha512-doV4thUwgkrycJH4yLeqwTGIIZphHl+pk7CPReuMIhYhncmgzdko85MaCG4YQFTxqMFr1/oEH32tZuKKovcDEg=="
     },
+    "[email protected]": {
+      "integrity": "sha512-h4gvMgoOtI46NfIleHLOMhOvj/cqWw3KWkqehssDiUgSoLO7wjRgMaW6188DQmArTpoFFMVCD15IWYfq/ltM2g==",
+      "bin": true
+    },
     "[email protected]": {
       "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",
       "os": ["android"],
@@ -741,6 +746,7 @@
       "npm:@types/node@^24.19.2",
       "npm:@typescript/native-preview@^7.0.0-dev.20260707.2",
       "npm:[email protected]",
+      "npm:[email protected]",
       "npm:openid-client@^6.8.8",
       "npm:svelte-check@^4.7.7",
       "npm:svelte@^5.57.3",
diff --git a/src/lib/server/highlight.ts b/src/lib/server/highlight.ts
index 7851732..c01ea99 100644
--- a/src/lib/server/highlight.ts
+++ b/src/lib/server/highlight.ts
@@ -3,9 +3,12 @@
  */
 
 import hljs from "highlight.js";
+import jpcl from "jpcl-lang/highlightjs";
 
 const MAX_HIGHLIGHT_LENGTH = 128 * 1024;
 
+hljs.registerLanguage("jpcl", jpcl);
+
 export const highlightLanguages = hljs.listLanguages().sort();
 
 const FILE_LANGUAGES = new Map([
@@ -25,6 +28,7 @@ const EXTENSION_LANGUAGES = new Map([
   ["bash", "bash"],
   ["h", "c"],
   ["hpp", "cpp"],
+  ["jp", "jpcl"],
   ["mdown", "markdown"],
   ["mkd", "markdown"],
   ["mkdn", "markdown"],
diff --git a/test/markdown.test.mjs b/test/markdown.test.mjs
index e34ccca..d8d9295 100644
--- a/test/markdown.test.mjs
+++ b/test/markdown.test.mjs
@@ -147,6 +147,13 @@ check(
   "labelled fences highlight code",
   has("```js\nconst a = 1;\n```", '<span class="hljs-keyword">const</span>'),
 );
+check(
+  "JPCL Markdown fences use JPCL 2 syntax",
+  has(
+    "```jpcl\n[config]\nenabled: true ~~ a comment\n```",
+    '<span class="hljs-literal">true</span> <span class="hljs-comment">~~ a comment</span>',
+  ),
+);
 check(
   "nested document links keep the directory and selected revision",
   renderMarkdown(