Add Download Markdown link with proper filename generation#2876
Add Download Markdown link with proper filename generation#2876mich-elle-luna wants to merge 1 commit intomainfrom
Conversation
- Added download link in the page meta-links sidebar - Generates unique filename based on page path/title - Uses JavaScript fetch to download with custom filename - Positioned alongside Edit and Create Issue links
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
| <script> | ||
| function downloadMarkdown(url, filename) { | ||
| fetch(url) | ||
| .then(response => response.blob()) |
There was a problem hiding this comment.
Fetch doesn't check response status before downloading
Medium Severity
The fetch call pipes response.blob() without checking response.ok first. If the server returns a non-2xx status (e.g., 404 or 500), the error page HTML body is silently converted to a blob and downloaded as a .md file. The user receives a file that appears valid but contains HTML error content instead of the expected markdown.
|
[Confused response deleted.] Oh... I see. There's a bunch of JSON metadata, followed by the actually page content in Markdown. |
|
Thanks David, yes it is a bit confusing, the idea is that a person could download an entire file and put it into the context window of their coding assistant using these links. |
dwdougherty
left a comment
There was a problem hiding this comment.
Thanks for the additional context, @mich-elle-luna. The proposed changes seem to do what you intended, but I haven't done extensive testing; just a few pages here and there. That said, I'll go ahead and approve.


Note
Low Risk
Small UI/template change that adds a client-side download action; risk is limited to potential CSP/browser quirks or missing
markdownoutput format on some pages.Overview
Adds a Download Markdown action to the page meta-links sidebar alongside Edit/Issue links.
The partial now detects the page’s
markdownalternative output URL, generates a sanitized.mdfilename (prefer page path, fallback to title), and uses an inlinefetch+Blob helper to download the rendered Markdown when available.Written by Cursor Bugbot for commit 479c0b4. This will update automatically on new commits. Configure here.