dsh-user-markdown: Render user messages as Markdown in DSH Web GUI

Introduction

In the DeepSeek Harness (DSH) Web interface, model replies are rendered as Markdown by default, while user-sent content has long been displayed as plain text (white-space: pre-wrap). The **emphasis**, `commands`, lists, and fenced code blocks you input remain as literal symbols in historical chat bubbles, requiring you to mentally “pre-compile” them when reviewing conversations.

towardsdawn/dsh-user-markdown is a client-side plugin released by maintainer TowardsDawn. It only modifies browser-side display, aligning user bubbles with model bubbles in terms of Markdown rendering. The plugin has been indexed on the DSH Market, and the community directory page can be found at SkillHub.

What is this

dsh-user-markdown is a zero-dependency, build-free DSH Web client plugin. It does not modify conversation data, configuration, or model context; loading and unloading only affect the display method of user messages within the GUI.

The current package version is 1.0.2, licensed under MIT, targeting the web platform. The package.json requires Node >=22.19.0 and DSH engine >=0.1.5-rc.1 <1.0.0.

Core Features

The following capabilities are described in the README and are consistent with the implementation.

Rendering Scope

  • Persistent user messages, steering inputs, and optimistic display bubbles are all rendered.
  • Supports common Markdown syntax such as headings (#–######), bold/italic/strikethrough, inline code and fenced code blocks (no syntax highlighting; displays language label or “Code Block” at the top), links, lists, blockquotes, horizontal rules, tables, and images.
  • Intra-paragraph line breaks are treated as hard breaks (<br>); behavior regarding isolated \r etc. remains consistent with DSH’s native pre-wrap display to avoid inconsistencies in line structure before and after rendering.

Security & Theming

  • Text is HTML-escaped first; links follow a protocol whitelist (http(s), mailto, tel, relative paths, #), while javascript:, data:, etc., are downgraded.
  • Styles use neutral, semi-transparent colors to adapt to both light and dark themes.

Coexistence with Other Plugins

This plugin does not register the conversation.chat.node slot, so it will not override plugins like dsh-easyrewrite or dsh-rewind-plugin that replace user bubble renderers. The implementation uses DOM enhancement: after React rendering completes, a MutationObserver locates符合条件的 plain-text message body containers and inserts the rendered result. Bubbles containing @file reference chips, attachment blocks, or edit states (textarea / input / contenteditable) are skipped to avoid breaking structures.

Runtime Control

A one-line toggle is available in the browser console, e.g., window.__dshUserMarkdown.toggle(); the state is saved in localStorage['dsh-user-markdown:enabled']. You can also disable the plugin from the configuration side by setting the plugin entry to disabled: true in ~/.dsh/profiles/web/cordis.patch.yml.

Installation & Activation

Prerequisites: dsh and pnpm must be in the system PATH (dsh plugin forwards to pnpm).

First, install to the web profile from GitHub (copy installation, no build required for the repo):

dsh plugin --profile web add "github:TowardsDawn/dsh-user-markdown"

The installation process automatically: packs the package into ~/.dsh/profiles/web, writes to dsh.profile.bundles, and integrates into the assembly tree via cordis.patch.yml. After completion, restart DSH:

dsh web

Verify if the assembly includes this plugin:

dsh --profile web --dump-config | grep dsh-user-markdown

Confirm in the GUI’s DevTools console that the client is mounted:

typeof window.__dshUserMarkdown        // "object"
window.__dshUserMarkdown.enabled()     // true

Updates are available:

dsh plugin --profile web update dsh-user-markdown

Uninstall:

dsh plugin --profile web remove dsh-user-markdown

Then restart dsh web again.

Typical Usage

Works immediately upon installation, no additional configuration files needed.

Temporarily disable or restore Markdown display (effective immediately; persists after refresh according to localStorage):

window.__dshUserMarkdown.disable()
window.__dshUserMarkdown.enable()
window.__dshUserMarkdown.toggle()
window.__dshUserMarkdown.refresh()
window.__dshUserMarkdown.render('# Test')

Simply write Markdown in the input box and send; for a comparison before and after installation, refer to the examples in the README: ## Heading, lists, and `npm run build` will appear as corresponding styles after installation, rather than literal backticks and asterisks.

Use Cases & Notes

Suitable for: DSH users who frequently write structured explanations, commands, or checklists in user messages, wish to view them directly in Web history, and may use bubble-related plugins like easyrewrite or rewind simultaneously.

Limitations (from source materials):

  • Messages containing reference chips / attachment blocks are not rendered (pure text-like bubbles only).
  • Only affects the Web GUI; does not work on the TUI / ACP terminal side.
  • Relies on DSH’s DOM conventions (such as data-chat-flow-kind="user" | "steering"); if upstream changes attributes, the plugin may silently fail.

Recommendation before installation: DSH plugins run with the current dsh process and user permissions. Before installing, please review the GitHub repository source code and the MIT license to ensure it meets your environment and security requirements. Community directories (SkillHub, DSH Market) are independent ecosystem sites and have no official affiliation with DeepSeek / High-Flyer.

Conclusion

dsh-user-markdown fills the gap in the DSH Web GUI experience where “only models are rendered, not users”: zero-build, non-conflicting with slots, and data-non-invasive. It is suitable as a display layer enhancement for daily Markdown user messages.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye