You've already forked joplin
mirror of
https://github.com/laurent22/joplin.git
synced 2025-07-13 00:10:37 +02:00
Desktop: Allow 'Paste as Text' on the Rich Text Editor (#7751)
This commit is contained in:
16
packages/app-desktop/gui/NoteEditor/commands/pasteAsText.ts
Normal file
16
packages/app-desktop/gui/NoteEditor/commands/pasteAsText.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { CommandRuntime, CommandDeclaration } from '@joplin/lib/services/CommandService';
|
||||
import { _ } from '@joplin/lib/locale';
|
||||
|
||||
export const declaration: CommandDeclaration = {
|
||||
name: 'pasteAsText',
|
||||
label: () => _('Paste as text'),
|
||||
};
|
||||
|
||||
export const runtime = (comp: any): CommandRuntime => {
|
||||
return {
|
||||
execute: async () => {
|
||||
comp.editorRef.current.execCommand({ name: 'pasteAsText' });
|
||||
},
|
||||
enabledCondition: 'oneNoteSelected && richTextEditorVisible',
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user