mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: slash commands are no more shown in the code blocks
This commit is contained in:
parent
768d141729
commit
13ba7d59e0
@ -54,7 +54,20 @@ const Command = Extension.create<SlashCommandOptions>({
|
|||||||
props.command({ editor, range });
|
props.command({ editor, range });
|
||||||
},
|
},
|
||||||
allow({ editor }: { editor: Editor }) {
|
allow({ editor }: { editor: Editor }) {
|
||||||
return !editor.isActive("table");
|
const { selection } = editor.state;
|
||||||
|
|
||||||
|
const parentNode = selection.$from.node(selection.$from.depth);
|
||||||
|
const blockType = parentNode.type.name;
|
||||||
|
|
||||||
|
if (blockType === "codeBlock") {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (editor.isActive("table")) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
},
|
},
|
||||||
allowSpaces: true,
|
allowSpaces: true,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user