mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-06-11 19:56:57 +08:00
docs: update content
This commit is contained in:
parent
f9059a372f
commit
f74f1ac885
@ -387,15 +387,18 @@ import Strike from '@tiptap/extension-strike'
|
|||||||
import { markInputRule } from '@tiptap/core'
|
import { markInputRule } from '@tiptap/core'
|
||||||
|
|
||||||
// Default:
|
// Default:
|
||||||
// const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm
|
// const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/
|
||||||
|
|
||||||
// New:
|
// New:
|
||||||
const inputRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))$/gm
|
const inputRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))$/
|
||||||
|
|
||||||
const CustomStrike = Strike.extend({
|
const CustomStrike = Strike.extend({
|
||||||
addInputRules() {
|
addInputRules() {
|
||||||
return [
|
return [
|
||||||
markInputRule(inputRegex, this.type),
|
markInputRule({
|
||||||
|
find: inputRegex,
|
||||||
|
type: this.type,
|
||||||
|
}),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -414,15 +417,18 @@ import Strike from '@tiptap/extension-strike'
|
|||||||
import { markPasteRule } from '@tiptap/core'
|
import { markPasteRule } from '@tiptap/core'
|
||||||
|
|
||||||
// Default:
|
// Default:
|
||||||
// const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm
|
// const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g
|
||||||
|
|
||||||
// New:
|
// New:
|
||||||
const pasteRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))/gm
|
const pasteRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))/g
|
||||||
|
|
||||||
const CustomStrike = Strike.extend({
|
const CustomStrike = Strike.extend({
|
||||||
addPasteRules() {
|
addPasteRules() {
|
||||||
return [
|
return [
|
||||||
markPasteRule(pasteRegex, this.type),
|
markPasteRule({
|
||||||
|
find: pasteRegex,
|
||||||
|
type: this.type,
|
||||||
|
}),
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user