Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions packages/toolbar/src/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
<div style="margin-bottom: 8px;">Download as:</div>
<ul>
<li>
Source markdown (just the content)<br/>
<button type="button" id="download-md" style="margin-right: 8px;">Source markdown</button>
Source (just the ${this.mode} content)<br/>
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
<button type="button" id="download-md" style="margin-right: 8px;">Source</button>
</li>
<li>
HTML wrapper (content plus a shareable viewer)<br/>
Expand Down Expand Up @@ -127,8 +127,10 @@
const textarea = this.options.textarea;
if (!textarea) return;
const content = textarea.value;
const filename = `${filenameWithoutPathOrExtension(this.filename)}.idoc.md`;
this.triggerDownload(content, filename, 'text/markdown');
const extension = this.mode === 'json' ? '.idoc.json' : '.idoc.md';
const mimeType = this.mode === 'json' ? 'application/json' : 'text/markdown';
const filename = `${filenameWithoutPathOrExtension(this.filename)}${extension}`;
this.triggerDownload(content, filename, mimeType);
});

// Download as HTML wrapper
Expand Down