





















@@ -136,8 +136,10 @@ All fields are optional unless noted.
136136 Display filename for before and after mode.
137137</ParamField>
138138<ParamField path="lang" type="string">
139- Language override hint for before and after mode. Unknown values fall back to plain text.
139+ Language override hint for before and after mode. Unknown values and languages outside the default viewer set fall back to plain text unless the
140+ Diff Viewer Language Pack plugin is installed.
140141</ParamField>
142+141143<ParamField path="title" type="string">
142144 Viewer title override.
143145</ParamField>
@@ -200,6 +202,22 @@ All fields are optional unless noted.
200202 </Accordion>
201203</AccordionGroup>
202204205+## Syntax highlighting
206+207+OpenClaw includes syntax highlighting for common source, config, and documentation languages:
208+209+`javascript`, `typescript`, `tsx`, `jsx`, `json`, `markdown`, `yaml`, `css`, `html`, `sh`, `python`, `go`, `rust`, `java`, `c`, `cpp`, `csharp`, `php`, `sql`, and `docker`.
210+211+Common aliases such as `js`, `ts`, `bash`, `md`, `yml`, `c++`, and `dockerfile` are normalized to those default languages.
212+213+Install the Diff Viewer Language Pack plugin to highlight other languages:
214+215+```bash
216+openclaw plugins install diffs-language-pack
217+```
218+219+With the language pack available, OpenClaw automatically uses it for languages outside the default list. Without it, those files stay readable as plain text.
220+203221## Output details contract
204222205223The tool returns structured metadata under `details`.
@@ -385,6 +403,7 @@ Viewer assets:
385403386404- `/plugins/diffs/assets/viewer.js`
387405- `/plugins/diffs/assets/viewer-runtime.js`
406+- `/plugins/diffs-language-pack/assets/viewer.js` when the diff uses a language from the Diff Viewer Language Pack
388407389408The viewer document resolves those assets relative to the viewer URL, so an optional `baseUrl` path prefix is preserved for both asset requests too.
390409此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。