From 13c0097447bf5241697fa3b965afea6290bfdc8d Mon Sep 17 00:00:00 2001 From: Nathan Daniels Date: Sun, 15 Nov 2026 01:28:27 -0500 Subject: [PATCH] fix: support syntax highlighting with multi-word code fence info strings --- server/utils/mdKit.ts | 3 ++- test/unit/server/utils/readme.spec.ts | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/server/utils/mdKit.ts b/server/utils/mdKit.ts index 8150de86ad..dc020a242d 100644 --- a/server/utils/mdKit.ts +++ b/server/utils/mdKit.ts @@ -59,7 +59,8 @@ export async function createCodeHighlighter(): Promise { // Syntax highlighting for code blocks (uses shared highlighter) return ({ text, lang }: Tokens.Code) => { - const html = highlightCodeSync(shiki, text, lang || 'text') + const language = (lang || '').match(/^\S+/)?.[0] || 'text' + const html = highlightCodeSync(shiki, text, language) // Add copy button return `