1
0
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:
pedr
2023-02-13 16:16:33 -03:00
committed by GitHub
parent d55d4d42e5
commit c706b8dd2f
9 changed files with 43 additions and 1 deletions

View 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',
};
};