Skip to content

Commit

Permalink
Merge pull request #3942 from nextcloud/backport/stable26/3941
Browse files Browse the repository at this point in the history
[stable26] feat: Add Shift-Mod-C for copying the markdown source
  • Loading branch information
juliusknorr authored Mar 22, 2023
2 parents 18cce80 + 4c5b6c8 commit aa9b0cc
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 21 deletions.
4 changes: 2 additions & 2 deletions js/editor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/editor.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/files-modal.js

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

2 changes: 1 addition & 1 deletion js/files-modal.js.map

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

4 changes: 2 additions & 2 deletions js/text-editors.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-editors.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-files.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-files.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-public.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-public.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-text.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-text.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions js/text-viewer.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/text-viewer.js.map

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,14 @@ export default {
this.$syncService.save()
return true
},
'Shift-Mod-c': ({ editor }) => {
if (!navigator?.clipboard) {
console.error('Clipboard API is not available')
}

const proseMirrorMarkdown = this.$syncService.serialize(editor.state.doc)
navigator.clipboard.writeText(proseMirrorMarkdown)
},
}),
],
enableRichEditing: this.isRichEditor,
Expand Down

0 comments on commit aa9b0cc

Please sign in to comment.