]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
webui: add rehype plugin to restore HTML in Markdown table cells (#17477)
authorPascal <redacted>
Tue, 25 Nov 2025 07:01:02 +0000 (08:01 +0100)
committerGitHub <redacted>
Tue, 25 Nov 2025 07:01:02 +0000 (08:01 +0100)
commitb1846f1c8ecd97ee08593e9498ef3244d43c1ad6
treef9790aec175ed02db1eb3dea364ea814deb9b3a5
parentd414db02d3ab3744402bc57a7b3fce7de66e3d5a
webui: add rehype plugin to restore HTML in Markdown table cells (#17477)

* webui: add rehype plugin to restore HTML in Markdown table cells

The remark/rehype pipeline neutralizes inline HTML as literal text
(remarkLiteralHtml) so that XML/HTML snippets in LLM responses display
as-is instead of being rendered. This causes <br> and <ul> markup in
table cells to show as plain text.

This plugin traverses the HAST post-conversion, parses whitelisted HTML
patterns (<br>, <ul><li>) from text nodes, and replaces them with actual
HAST element nodes. For lists, adjacent siblings must be combined first
as the AST fragmentation breaks pattern matching.

Strict validation rejects malformed markup, keeping it as raw text.

* chore: update webui build output
tools/server/public/index.html.gz
tools/server/webui/src/lib/components/app/misc/MarkdownContent.svelte
tools/server/webui/src/lib/constants/table-html-restorer.ts [new file with mode: 0644]
tools/server/webui/src/lib/markdown/table-html-restorer.ts [new file with mode: 0644]