remove verbal expressions
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import { Node, CommandSpec } from '@tiptap/core'
|
||||
import { NodeSpec } from 'prosemirror-model'
|
||||
import VerEx from 'verbal-expressions'
|
||||
import { Node } from '@tiptap/core'
|
||||
import { textblockTypeInputRule } from 'prosemirror-inputrules'
|
||||
|
||||
type Level = 1 | 2 | 3 | 4 | 5 | 6
|
||||
@@ -45,14 +43,7 @@ export default new Node<HeadingOptions>()
|
||||
}))
|
||||
.inputRules(({ options, type }) => {
|
||||
return options.levels.map((level: Level) => {
|
||||
const regex = VerEx()
|
||||
.startOfLine()
|
||||
.find('#')
|
||||
.repeatPrevious(level)
|
||||
.whitespace()
|
||||
.endOfLine()
|
||||
|
||||
return textblockTypeInputRule(regex, type, { level })
|
||||
return textblockTypeInputRule(new RegExp(`^(?:#){${level}}\s$/gm`), type, { level })
|
||||
})
|
||||
})
|
||||
.create()
|
||||
|
||||
Reference in New Issue
Block a user