Introduction¶
In usage scenarios for DSH (DeepSeek Harness), agent-generated output is often in Markdown files. Clicking these links typically invokes the default Markdown editor or viewer, which interrupts the current workflow and requires frequent window switching. We need a way to preview these documents directly within the DSH interface.
Plugin Overview¶
dsh-markdown-link-preview is a plugin maintained by Lukeknow0. Its core purpose is to intercept click events in the chat area that point to same-origin Markdown files, render the content directly in DSH Better Sidebar, and replace the behavior of opening external applications.
Installation and Prerequisites¶
Before installing, ensure that the dsh-better-sidebar plugin is installed and enabled.
Run the following command to install the plugin:
dsh plugin --profile web add github:Lukeknow0/dsh-markdown-link-preview
After installation, restart or refresh the DSH Web page.
Core Features¶
This plugin mainly provides the following capabilities:
- Click Capture and Rendering: Captures ordinary left clicks in the chat area that point to same-origin Markdown files and opens an independent tab in the sidebar for each document.
- Multi-Document Side-by-Side: Supports opening multiple Markdown files simultaneously in the sidebar for comparative reading.
- Markdown Rendering: Supports GitHub Flavored Markdown, code blocks, tables, images, and rendering of relative links.
- Security Sanitization: Uses
markedfor parsing andDOMPurifyto sanitize the generated HTML, helping prevent XSS attacks. - Same-Origin Restriction: Only takes over HTTP(S) URLs that are same-origin with the DSH page. It does not take over cross-origin links,
file:,data:, orjavascript:URLs. - Native Behavior Preservation: For
Cmd/Ctrlclicks, context menus, and new-window operations, it fully preserves the original browser behavior and does not intervene.
Use Cases and Notes¶
- Dependency Environment: This plugin depends on
dsh-better-sidebarand requires a React version of 18.2.0 or higher. - Privacy and Security: The plugin does not upload document content and does not connect to any remote services. The Markdown HTML is sanitized with DOMPurify before rendering.
- Source Code Review: Although the license is MIT, it is recommended to review the source code in the GitHub repository before use in production to ensure compliance with current security and compliance requirements.
Summary¶
With dsh-markdown-link-preview, you can seamlessly preview same-origin Markdown files in DSH Better Sidebar and avoid frequently switching to external applications. The plugin provides basic security through same-origin restrictions and DOMPurify sanitization. For more details, visit the GitHub repository.