dsh-markdown-live: Real-time Markdown Rendering for DSH Input Box and User Messages

Introduction

When writing long prompts in the DSH desktop client, the input box is usually plain text: titles, lists, and code fences rely on visually aligning #, -, and backticks, making it difficult to judge the final formatting before sending. While the assistant’s replies often have Markdown rendering, the user’s own sent messages remain in their raw form, leading to an inconsistent reading experience in the conversation.

dsh-markdown-live is a community-maintained client plugin (maintainer 9426Haruka, repository 9426Haruka/dsh-markdown-live). Without altering the submitted content, it provides real-time Markdown rendering for the composition area and applies the host’s standard Markdown rendering to already-sent user text. The plugin is categorized as “Client,” currently has 0 GitHub stars, is licensed under MIT, and is at package version 0.2.9.

What is this

In short: A DSH desktop plugin that provides real-time Markdown rendering within the input box, plus displays user messages as Markdown; what is sent to the backend remains literal Markdown, unchanged byte-for-byte.

In terms of implementation, all browser logic is concentrated in a single file client.js with no build steps required; the Host-side index.js provides the toggleable option in “Settings → Plugins”. The plugin relies on DSH’s built-in @deepseek-ai/dsh-client-locale and @deepseek-ai/dsh-client-ui-conversation client plugins and targets DSH Desktop version 0.2.x (web platform client bundle).

Core Features

Composer (Input Box)

  • Live Rendering: When typing or pasting Markdown, syntax is immediately presented with styles without needing to send first.
  • Marker Fading: Syntax markers remain faintly visible on the line where the cursor is; on other lines, #, *, ~~, backticks, [](), -, >, etc., automatically hide, approaching a WYSIWYG (What You See Is What You Get) experience.
  • Block Styles: Supports #~###### headings, > quotes, unordered/ordered/task lists (including indentation), code fences (including language names; fence lines can be collapsed when not on the cursor line), and --- dividers.
  • Interaction: Shift+Enter automatically continues lists/quotes; Backspace can remove markers or exit empty code lines; code fences auto-complete; multi-line pastes into lists/quotes automatically add prefixes.
  • Chinese Input: Text color remains normal during the Pinyin composition phase; spaces between markers and text are treated as normal text nodes, allowing the cursor to rest within them.
  • Submission Unchanged: Rendering only affects the display layer (Lexical format bits and DOM classes); the submitted text remains raw Markdown.

To maintain fluidity, live rendering pauses when the draft exceeds 12,000 characters.

Sent User Messages

Overrides the text cell of conversation.user.text.node (priority -1) and uses MarkdownText from @deepseek-ai/dsh-client-ui-primitives to render raw. @ mentions, skill chips, and message action buttons are preserved; file/folder/skill nodes still use the host’s original renderer. Normal line breaks are preserved.

Supported Syntax (Summary)

Inline: Bold, italic, strikethrough, inline code, links, and image syntax (images styled as links, not inlined). Block: Headings (requires space and content after #), quotes, lists, task lists, ``` / ~~~ fences, dividers. No inline parsing is done inside fences; no syntax highlighting is applied to code within the input box (code blocks in sent messages are highlighted by the host).

Custom Styling

Colors are exposed via CSS variables and can be overridden in DSH custom styles, for example:

[data-composer-input] {
  --dml-code-bg: #eceef0;        /* Inline code background */
  --dml-code-block-bg: #eceef0;  /* Code block background */
  --dml-mark-ink: rgba(127, 127, 127, 0.55); /* Syntax marker color */
}

Installation & Activation

This repository is the plugin bundle directory (containing package.json, cordis.patch.yml, index.js, client.js). You must place this directory locally first, then install it in DSH:

  1. Open Settings → Plugins, use “Install Plugin / Install from Local”, and select the plugin directory; OR
  2. Use the agent’s plugin_manager tool:
plugin_manager install_bundle(target = "<absolute path to plugin directory>")

After installation, the list will display the name dsh-markdown-live, which can be toggled at any time; changes take effect after reloading the client. Uninstallation: Disable or remove via settings; the plugin does not modify files outside the profile.

The plugin runs client-side with the current DSH process permissions. It is recommended to read the repository source code and MIT license before installation to ensure it complies with your usage environment.

Typical Usage

No additional configuration is required: Once the plugin is enabled, simply write Markdown directly in the conversation input box to see real-time styles; after sending, your user messages will be displayed with Markdown formatting, while the API/session still saves the identical literal text.

When developing or modifying, changes to client.js will trigger a hot reload of the client bundle by the host. Syntax check:

node --check client.js

Use Cases & Notes

Suitable for: Developers who frequently write structured prompts (headings, lists, code blocks, task lists) in DSH; scenarios requiring visual consistency before and after sending while maintaining the submitted text as pure Markdown.

Known Limitations (from repository description):

  • Tables (| rows) are not adapted and are displayed as plain text.
  • Rich text pastes will be re-colored as plain text Markdown; HTML styles are not preserved.
  • Depends on DSH’s internal Lexical node structure; adaptation may be required after major DSH version upgrades.

The community plugin directory dsh-markdown-live on skillhub.cn has no official affiliation with DeepSeek or High-Flyer; the DSH ecosystem emphasizes “Everything is a Plugin,” and the directory site is used for discovery and distribution of community works.

Conclusion

dsh-markdown-live supplements the Markdown preview in the composition area and the Markdown display of sent user messages into a single client plugin, without altering the submitted literals. To try it out or contribute code, you can visit the directory page and GitHub repository:

  • Directory: https://www.skillhub.cn/plugins/9426Haruka/dsh-markdown-live
  • Source: https://github.com/9426Haruka/dsh-markdown-live
羽毛球分组比赛记分
小程序二维码

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

Xiaoye