Preface¶
When running conversations in DeepSeek Harness Web, the assistant’s replies are output in a token-by-token streaming manner. The default Markdown renderer often encounters flickering, structural disorganization, or instantaneous UI replacement by another implementation when the message is complete when facing unclosed bold, code fences, tables, or mathematical formulas.
dsh-better-markdown is a community-maintained Web client plugin that uses markstream-react to take over the Markdown parsing and rendering of assistant messages in the chat area, sharing the same renderer across both streaming and settled states. Below, we introduce its positioning, capabilities, and installation methods.
What Is This¶
dsh-better-markdown is maintained by zerob13. The current npm version is 0.1.2, licensed under MIT. The plugin does not modify Harness source code; it injects rendering logic through Harness’s public client module and slot shadowing.
The core replacement scope is all assistant Markdown with streaming status in Web conversations; static surfaces such as plan review and trajectory still use Harness’s built-in MarkdownText and are not within the replacement scope.
Why Switch to markstream-react¶
markstream-react comes from the React version of the Simon-He95/markstream-vue monorepo. This plugin only imports the React package and does not bring in the Vue runtime.
Compared to the default pipeline, the plugin emphasizes the following points:
- Designed for streaming output: Continuously handles unclosed bold, code fences, lists, tables, and mathematical expressions, suitable for LLM token streams.
- Reduced completion state switching: Streaming and settled assistant messages share the same Markstream renderer, avoiding the replacement of the entire Markdown UI upon completion.
- Richer Markdown support: Supports common Markdown, tables, task lists, quotes, links, images, KaTeX mathematical formulas, and Mermaid diagrams.
- Compatible with Harness scroll area: Disables viewport lazy mounting unsuitable for internal chat scroll containers, preventing visible content from remaining in skeleton placeholder state.
- Clear security boundaries: Raw HTML uses
htmlPolicy="escape"; links, images, and settled file mentions continue to execute Harness’s restriction policies; Mermaid uses strict mode.
Core Features¶
| Capability | Behavior |
|---|---|
| Assistant streaming Markdown | Entirely handled by markstream-react |
| Settled assistant Markdown | Continues using the same Markstream renderer |
| Mermaid | Plugin includes mermaid@11.16.1, no additional installation needed |
| Math | KaTeX inline / display math |
| Code fences | Uses Markstream MarkdownCodeBlockNode + stream-markdown + Shiki; unknown languages fallback to visible plain text |
| Raw HTML | Escaped as text, not injected into DOM |
| Links and images | Only safe external protocols allowed |
| Static surfaces like Plan review / trajectory | Continue using Harness built-in MarkdownText |
Code blocks are rendered by Markstream MarkdownCodeBlockNode and stream-markdown, using Shiki for streaming highlighting, and preserving language titles, copy, and expand operations; reasoning, attachments, and stop states maintain Harness’s original behavior.
How It Works¶
Assistant token stream
-> Harness session projection
-> conversation.chat.node / assistant-step
|- priority -100: BetterAssistantNodeView
| -> markstream-react (active)
| `- fenced code -> stream-markdown -> Shiki
`- priority 0: Harness built-in (fallback)
Low-priority shadow entries handle normal rendering; if the plugin renderer throws an error or is unloaded, Harness’s original renderer remains in the slot and automatically takes over.
Installation and Enabling¶
Prerequisite: DeepSeek Harness Web can start normally.
Install from npm (Recommended)¶
dsh plugin --profile web add dsh-better-markdown
dsh --profile web --dump-config
dsh --profile web
Update the plugin:
dsh plugin --profile web add dsh-better-markdown@latest
The configuration output should include:
# == dsh-better-markdown
- id: better-markdown
name: dsh-better-markdown
After opening the Web, the assistant Markdown root node will have the attribute data-markdown-renderer="markstream-react", which can be used to confirm that the plugin is effective.
Install from Source¶
Prerequisites: Node.js 20+, pnpm 10+.
git clone https://github.com/zerob13/dsh-better-markdown.git
cd dsh-better-markdown
pnpm install
pnpm run check
pnpm run build
dsh plugin --profile web add "$(pwd)"
dsh --profile web --dump-config
dsh --profile web
For Windows PowerShell, replace "$(pwd)" with (Get-Location).Path.
Install from Git¶
pnpm 10/11 may require explicitly allowing builds in the Web profile’s pnpm-workspace.yaml:
allowBuilds:
dsh-better-markdown: true
Then execute:
dsh plugin --profile web add git+https://github.com/zerob13/dsh-better-markdown.git
dsh --profile web
It is recommended to fix the commit SHA for production environments rather than following the default branch long-term.
Removal¶
dsh plugin --profile web remove dsh-better-markdown
Uninstallation releases the slot shadow and Markstream component policy, and Harness’s built-in renderer immediately resumes.
Typical Usage¶
This plugin takes effect after installation without requiring additional configuration items. Verify the rendering effect by sending requests containing Markdown to the assistant in Web conversations, for example:
- Fenced code with language annotations, observe Shiki streaming highlighting and copy buttons;
- KaTeX mathematical formulas in
$$...$$or$...$formats; - Flowcharts or sequence diagrams in
```mermaidcode fences.
All the above content goes through the markstream-react rendering pipeline; if the plugin fails to load, Harness’s built-in renderer will automatically fall back.
Applicable Scenarios and Notes¶
Who Is This For
- Users who frequently read long replies, code blocks, formulas, or Mermaid diagrams in Harness Web conversations;
- Developers who want visual consistency between streaming output and completion states, reducing Markdown UI switching.
Compatibility
- DeepSeek Harness
0.1.0-rc.5and above; - React 18 and above;
- Only replaces the
assistant-stepin Web conversations; - Older versions of Harness without priority-based slot shadowing will fail to load directly, avoiding dual renderers.
Size and Trade-offs
The current browser bundle is approximately 7.40 MB, gzip approximately 1.59 MB. Mermaid and Shiki are both bundled to ensure offline availability; Shiki uses a pure JavaScript regex engine and fine-grained bundles for 34 commonly used languages. If Mermaid is not needed, removing its dependency can significantly reduce the bundle size, but Mermaid fences will not generate graphical previews.
Security Notice
The plugin runs with the current dsh process permissions and will load third-party npm dependencies (markstream-react, mermaid, shiki, katex, etc.). Before installation, it is recommended to read the source repository and MIT license to confirm they meet your environment requirements.
Conclusion¶
dsh-better-markdown hands over the assistant Markdown rendering in DeepSeek Harness Web’s chat area to markstream-react, maintaining the same implementation across streaming and settled states, and includes Mermaid, KaTeX, and Shiki code highlighting, with the ability to fall back to Harness’s built-in renderer in case of errors.
- Community directory: zerob13/dsh-better-markdown
- Source code and documentation: github.com/zerob13/dsh-better-markdown