fix: allow prompts starting with / (#6704)

fix: allow prompts starting with /
This commit is contained in:
Aditya Mitra 2025-07-18 21:03:38 +05:30 • committed by GitHub
parent 1c874e475e
commit c7abc56b0c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -15,6 +15,9 @@ export const SlashCommand = Node.create<SlashCommandOptions>({
addOptions() {
return {
suggestion: {
allow: ({ editor }) =>
// the first character is "/". we want to avoid slash commands when there is a space after it
editor.getText().at(1) !== " ",
char: "/",
pluginKey: new PluginKey(this.name),
startOfLine: true,