From f74f1ac885c94492d82e53bdc73828602de88a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20Ku=CC=88hn?= Date: Wed, 13 Oct 2021 20:53:25 +0200 Subject: [PATCH] docs: update content --- docs/guide/custom-extensions.md | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/docs/guide/custom-extensions.md b/docs/guide/custom-extensions.md index 5abe3128..506c8010 100644 --- a/docs/guide/custom-extensions.md +++ b/docs/guide/custom-extensions.md @@ -387,15 +387,18 @@ import Strike from '@tiptap/extension-strike' import { markInputRule } from '@tiptap/core' // Default: -// const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/gm +// const inputRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))$/ // New: -const inputRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))$/gm +const inputRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))$/ const CustomStrike = Strike.extend({ addInputRules() { 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' // Default: -// const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/gm +// const pasteRegex = /(?:^|\s)((?:~~)((?:[^~]+))(?:~~))/g // New: -const pasteRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))/gm +const pasteRegex = /(?:^|\s)((?:~)((?:[^~]+))(?:~))/g const CustomStrike = Strike.extend({ addPasteRules() { return [ - markPasteRule(pasteRegex, this.type), + markPasteRule({ + find: pasteRegex, + type: this.type, + }), ] }, })