add basic inputrules and pasterules
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { Mark } from '@tiptap/core'
|
||||
import { Mark, markInputRule, markPasteRule } from '@tiptap/core'
|
||||
import { toggleMark } from 'prosemirror-commands'
|
||||
import { MarkSpec } from 'prosemirror-model'
|
||||
|
||||
@@ -44,4 +44,16 @@ export default class Bold extends Mark {
|
||||
}
|
||||
}
|
||||
|
||||
inputRules() {
|
||||
return [
|
||||
markInputRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)$/, this.schemaType),
|
||||
]
|
||||
}
|
||||
|
||||
pasteRules() {
|
||||
return [
|
||||
markPasteRule(/(?:\*\*|__)([^*_]+)(?:\*\*|__)/g, this.schemaType),
|
||||
]
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user