@ch4acko3/dsh-code-render
devtested: passnpmMIT
Escaped, theme-aware HTML code-block rendering service for DSH Web plugins, built on structured syntax-highlight tokens with source line-ending preservation.
下载量 / Downloads
913
依赖体积 / node_modules
19.73 MB
测试时间 / Tested
2026-11-07
DSH 版本 / Version
0.2.2-rc.1
Install
dsh plugin --profile web add @ch4acko3/dsh-code-render
Sandbox test results
| Stage | Result |
|---|---|
| 1 install | ✓ |
| 2 list | ✓ |
| 3 mount | ✓ |
| 4 boot | — |
Four stages run in an isolated sandbox: install (network on) → list → mount → boot (last three with no network).
README
@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.
Rendered from the README published on npm. Formatted only, not edited.
Versions
Published on npm::4,最后更新 2026-09-19