memorax-ai/dsh-render-engine

code-render

面向 DSH Web 插件的转义与主题响应 HTML 代码块渲染服务,基于结构化语法高亮 token,并保留源码换行符。

‍ 开发与运行时code-renderingcordisdeepseek-harness

@ch4acko3/dsh-code-render

A browser-side Cordis service that renders ctx.syntaxHighlighter tokens as safe, theme-aware HTML code blocks.

export const inject = ['codeRenderer']

export function apply(ctx) {
  const result = ctx.codeRenderer.render({
    code: 'const answer = 42',
    language: 'ts',
  })
  console.log(result.html)
}

Source text and HTML attributes are escaped. Colors follow DSH's --shiki-* CSS variables, and original LF, CRLF, or CR line endings are retained.