DSH Plugins Marketplace

DSH Plugins

Plugins

/

dsh-tex-block-normalizer

s

dsh-tex-block-normalizer

Manifest valid

DSH plugin: fix Pandoc-style $$ display-math blocks that DSH mis-parses into a red KaTeX parse error.

UI (client)hasBundlePatch

dsh-tex-block-normalizer

DSH Web 客户端插件:修好 Pandoc 风格 $$ 公式块在 DSH 里被误解析的问题——公式首行被静默丢弃、正文/表格/后续公式被吞进一个 KaTeX 报错节点,整段变成红色纯文本。

English: a DSH web-client plugin that normalizes Pandoc-style $$ display-math blocks before Markdown parsing, so messages other renderers show correctly no longer turn into a red KaTeX parse error in the DSH GUI.

症状

模型常这样写行间公式(开栏 $$ 与内容同行、正文跨行、收尾 $$ 贴在最后一个内容行末):

$$\frac{\partial}{\partial y} = 1
\quad\Longrightarrow\quad
x = y$$

在 DSH 里它会:首行被当成 info 字符串静默丢弃;$$ 块永不闭合,从第二行到消息结尾全部被吞;KaTeX 拿到这一大段非 TeX 文本后报 ParseError: ... Can't use function '$' in math mode ...,于是整段显示为红色纯文本(悬停可见该报错)。同一个文件在 VS Code 的 Markdown 预览里是正常的。

DSH 接受的形状

写法DSH 0.1.7-rc.1
$$ 独占一行 … $$ 独占一行✅ 正确
整条公式一行 $$ … $$✅ 正确
$$内容 开头、$$ 独占一行收尾⚠️ 首行被静默丢弃
$$ 独占一行、内容$$ 收尾❌ 吞掉文档剩余部分
$$内容 开头、内容$$ 收尾❌ 丢首行 + 吞文档

插件把后三种统一搬成第一种:只移动 $$ 的换行位置,块内内容一字不改。对会话里已经记录的历史消息同样生效(归一化发生在渲染时,不修改 session 数据)。

安装

dsh plugin --profile web add <本包目录>

然后重启 dsh web 并刷新页面。

验证

  • 刷新后控制台出现一次 [dsh-tex-block-normalizer] active: Pandoc-style $$ blocks are normalized before Markdown parsing。

  • devtools 里查看 __DSH_TEX_BLOCK_NORMALIZER__ → { installed: true, reason: 'installed', stats: { calls, rewrites } };rewrites 增长即表示确实改写过度。

  • 打开此前报错的历史消息,红色纯文本消失、公式正常排版。

  • 临时关闭:页面加载前设 globalThis.__DSH_TEX_BLOCK_NORMALIZER_DISABLE__ = true。

  • 命令行审计任意 Markdown(用 DSH 的真实语法 + KaTeX 做归一化前后对照):

    node scripts/audit-markdown.mjs <file.md>
    

开发

npm install     # 仅测试用的 parser / katex devDependencies
npm test        # 21 项:归一化用例 + 打包产物 + DSH 语法验收
npm run build   # 改过 lib/normalize.js 后重新生成 lib/client.js

限制

  • 块引用 / 列表项里的 $$(> $$a、- $$a)不处理。
  • 完全没有收尾 $$ 的块保持原样,因此仍会吞到文件尾。
  • 依赖 React.memo 的 .type 是内层渲染函数这一 React 内部细节;取不到时插件安静地变成 no-op,不会报错影响界面。

完整说明见 docs/limitations.md。

文档

文档内容
docs/root-cause.md为什么 DSH 会这样解析:语法模型、上游实现位置、复现证据、与 VS Code 的差异
docs/how-it-works.md插件如何在不改动上游的前提下生效:seed 模块共享、MarkdownText 包装、生命周期与守卫
docs/development.md构建产物与单一事实来源、测试策略、夹具出处、审计工具
docs/limitations.md边界条件与背后的设计取舍

License

MIT

Comments

Loading…

Similar plugins

math-research-dsh

by xsoc1

DSH adaptation of the math-research Codex plugin marketplace: rigorous-open-math-research, manage-math-research-program, math-research-workflow, lean-verify as DeepSeek Harness skills.

Tools & CapabilitiesWorkflow & AutomationManifest valid

★ 3

MIT

Python

Sep 9, 2026

dsh plugin --profile web add math-research-dsh

by qianshe

DSH plugin: fold mis-rendered thinking/reasoning content into collapsible blocks and render mermaid diagrams inline.

Manifest valid

★ 3

MIT

JavaScript

Sep 5, 2026

dsh plugin --profile web add dsh-assistant-optimization

by zerob13

DeepSeek Harness Web plugin powered by markstream-react for resilient streaming Markdown, Mermaid diagrams, KaTeX math, and safe renderer fallback.

Models & ProvidersTools & CapabilitiesManifest valid

★ 19

↓ 142/wk

MIT

TypeScript

Aug 17, 2026

dsh plugin --profile web add dsh-better-markdown

by imkingjh999

DSH plugin: auto reasoning_effort (low/high/max) per turn via MiniMax complexity scorer + token ledger + per-reply metadata label

Models & ProvidersManifest valid

★ 0

MIT

TypeScript

Aug 26, 2026

dsh plugin --profile web add dsh-adaptive-effort

by flyingfishzxf

A simple DeepSeek API balance display plugin for dsh(deepseek-harness)

Tools & CapabilitiesModels & ProvidersTerminal & ClientsManifest valid

★ 0

MIT

JavaScript

Aug 30, 2026

dsh plugin --profile web add dsh-dsbal

by Zydr114

A dsh(deepseek-harness) plugin to enhance markdown rendering.

Manifest valid

★ 0

JavaScript

Aug 16, 2026

dsh plugin --profile web add dsh-client-ui-markdown-enhance