Skip to content

Commit f442bb9

Browse files
authored
Merge pull request #9 from github/clipboard-mime-type
Copy markdown to clipboard with custom mime type
2 parents 6ca65b3 + 36bca07 commit f442bb9

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

quote-selection.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ function onCopy(event: ClipboardEvent) {
5858
} catch (err) {
5959
return
6060
}
61-
const quoted = extractQuote(selection.toString(), range, true)
61+
62+
const text = selection.toString()
63+
const quoted = extractQuote(text, range, true)
6264
if (!quoted) return
6365

64-
transfer.setData('text/plain', quoted.selectionText)
66+
transfer.setData('text/plain', text)
67+
transfer.setData('text/x-gfm', quoted.selectionText)
6568
event.preventDefault()
6669

6770
selection.removeAllRanges()

0 commit comments

Comments
 (0)