diff --git a/packages/extension-heading/index.ts b/packages/extension-heading/index.ts index b153195eb..509027c9a 100644 --- a/packages/extension-heading/index.ts +++ b/packages/extension-heading/index.ts @@ -43,7 +43,7 @@ export default new Node() })) .inputRules(({ options, type }) => { return options.levels.map((level: Level) => { - return textblockTypeInputRule(new RegExp(`^(?:#){${level}}\s$/gm`), type, { level }) + return textblockTypeInputRule(new RegExp(`^(#{1,${level}})\\s$`), type, { level }) }) }) .create()