fix: Allow mention and emoji menus in headings

This commit is contained in:
Tom Moor
2023-09-14 09:11:18 -04:00
parent 7e17e82ac8
commit 924ab156f3

View File

@@ -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)
) {