Introduction

In DeepSeek Harness (DSH), assistant messages are usually rendered with HTML. Direct copying (Ctrl/Cmd+C) often loses information such as links, LaTeX source, and code block language, which can corrupt formatting when pasted into a Markdown editor. The following section introduces the dsh-message-copy-enhance plugin, which intercepts copy events and rewrites assistant output into complete Markdown.

Core Features

The plugin focuses on converting the copied content of assistant messages into Markdown format and preserving the structural information of specific elements:

  • Markdown output: Converts assistant output to Markdown.
  • Link preservation: Preserves links in the format [label](url).
  • LaTeX source preservation: Retrieves TeX source from MathML annotations.
  • Code block preservation: Preserves code blocks and extracts language from classes or banner information.
  • HTML to GFM: Restores standard HTML elements (headings, emphasis, lists, blockquotes, tables) to GitHub Flavored Markdown (GFM).

Installation and Activation

Install the plugin with the official command:

dsh plugin --profile desktop add dsh-message-copy-enhance

The package is in the pre-1.0 stage, and the version range ^0.1.0 covers only patch versions (0.1.x). To install the latest version, use the @latest tag.

Usage

  1. Select content in an assistant response message.
  2. Press Ctrl/Cmd + C to copy.
  3. Paste the content into a Markdown-supported editor such as Typora, Obsidian, or VS Code.

Notes

  • Interception scope: Only selections that start inside an assistant message ([data-chat-flow-kind="assistant"]) are intercepted. Cross-message selections are not intercepted.
  • Link recovery: Links filtered by the rendering whitelist (for example, file: links or relative links) do not have href and therefore cannot be recovered.
  • Code blocks: Only the selected lines are recovered. If the selection does not include the banner, the language label is missing.
  • KaTeX errors: Failed KaTeX elements (displayed as .katex-error) are output as $source$.
  • Tables: Tables are output as GFM pipe tables with escaped | characters.
  • Dependencies: Requires the peer dependency @deepseek-ai/cordis (^4.0.1).
  • Permissions: The plugin runs in the current DSH process context; check the source code and license before installing.

Summary

The plugin solves formatting loss when copying content from DSH assistant messages into Markdown editors. It uses a DOM-to-Markdown converter to ensure that key information, such as links, LaTeX source, and code block language, is preserved.