CH4ACKO3/dsh-render-engine--packages-syntax-highlight ↗★ 1

@ch4acko3/dsh-syntax-highlight

为 DeepSeek Harness Web 插件提供的结构化语法高亮服务。 核心用途是将共享 Shiki 引擎的输出转换为插件通用的稳定 Token 模型,确保高亮渲染的稳定性。适合需要定制化代码高亮逻辑的 Web 插件开发者。

套件
@ch4acko3/dsh-syntax-highlight
相容性
待驗證
Harness 依賴範圍
>=0.1.0-rc.8
Cordis 依賴範圍
^4.0.1
版本
0.1.1
授權
MIT
最近更新
2026年8月28日

同名套件的其他儲存庫

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:CH4ACKO3/dsh-render-engine#cca409bdfbcdb58e20267f970744d9b2918d218a&path:packages/syntax-highlight

@ch4acko3/dsh-syntax-highlight

A browser-side Cordis service that converts the shared ctx.shiki output into a stable token model for DeepSeek Harness plugins.

export const inject = ['syntaxHighlighter']

export function apply(ctx) {
  const result = ctx.syntaxHighlighter.highlight({
    code: 'const answer = 42',
    language: 'ts',
  })
  console.log(result.lines)
}

Unknown or absent language hints return plain tokens instead of throwing. The result's lineEndings field preserves the source's original LF, CRLF, or CR separators.