diff --git a/shared/editor/extensions/Suggestion.tsx b/shared/editor/extensions/Suggestion.tsx index dac0df174..64bdf2d76 100644 --- a/shared/editor/extensions/Suggestion.tsx +++ b/shared/editor/extensions/Suggestion.tsx @@ -14,9 +14,10 @@ export default class Suggestion extends Extension { inputRules = (_options: { type: NodeType; schema: Schema }) => [ new InputRule(this.options.openRegex, (state, match) => { + const { parent } = state.selection.$from; if ( match && - state.selection.$from.parent.type.name === "paragraph" && + (parent.type.name === "paragraph" || parent.type.name === "heading") && (!isInCode(state) || this.options.enabledInCode) && (!isInTable(state) || this.options.enabledInTable) ) {