1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-11-29 22:48:10 +02:00

Desktop: Plugins: Allow commands registered within the beta markdown editor to take arguments (#9963)

This commit is contained in:
Henry Heino
2024-02-22 13:30:48 -08:00
committed by GitHub
parent e5e191110c
commit fbeaf31a14
6 changed files with 57 additions and 16 deletions

View File

@@ -107,8 +107,8 @@ const useEditorCommands = (props: Props) => {
if ((editorRef.current as any)[value.name]) {
const result = (editorRef.current as any)[value.name](...value.args);
return result;
} else if (editorRef.current.commandExists(value.name)) {
const result = editorRef.current.execCommand(value.name);
} else if (editorRef.current.supportsCommand(value.name)) {
const result = editorRef.current.execCommand(value.name, ...value.args);
return result;
} else {
logger.warn('CodeMirror execCommand: unsupported command: ', value.name);