webui: fix syntax highlighting lost after streaming for non-common languages (#21206)

* webui: fix syntax highlighting lost for non-common languages after streaming

rehype-highlight uses lowlight internally, which only bundles 37 "common"
languages. The streaming code path uses highlight.js directly (192 languages),
so languages like Haskell highlight correctly while streaming but lose all
color once the code block closes. Pass the full lowlight language set to
rehype-highlight so both paths support the same languages.

* webui: rebuild static files after rebase
This commit is contained in:
Hamish M. Blair 2026-04-07 23:58:08 -07:00 committed by GitHub
parent 5c4aae66e1
commit 97508acb17
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 166 additions and 159 deletions

File diff suppressed because one or more lines are too long

View File

@ -18,7 +18,7 @@
<div style="display: contents">
<script>
{
__sveltekit_10avopp = {
__sveltekit_1ppa22i = {
base: new URL('.', location).pathname.slice(0, -1)
};

View File

@ -4,6 +4,7 @@
import remarkGfm from 'remark-gfm';
import remarkMath from 'remark-math';
import rehypeHighlight from 'rehype-highlight';
import { all as lowlightAll } from 'lowlight';
import remarkRehype from 'remark-rehype';
import rehypeKatex from 'rehype-katex';
import rehypeStringify from 'rehype-stringify';
@ -96,6 +97,7 @@
return proc
.use(rehypeHighlight, {
languages: lowlightAll,
aliases: { [FileTypeText.XML]: [FileTypeText.SVELTE, FileTypeText.VUE] }
}) // Add syntax highlighting
.use(rehypeRestoreTableHtml) // Restore limited HTML (e.g., <br>, <ul>) inside Markdown tables