Merge branch 'main' of github.com:ueberdosis/tiptap
This commit is contained in:
@@ -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,
|
||||
}),
|
||||
]
|
||||
},
|
||||
})
|
||||
|
||||
@@ -102,7 +102,7 @@ const CustomBold = Bold.extend({
|
||||
new Editor({
|
||||
extensions: [
|
||||
// …
|
||||
CustomBold(),
|
||||
CustomBold,
|
||||
],
|
||||
})
|
||||
```
|
||||
|
||||
@@ -47,7 +47,7 @@ yarn add @tiptap/react @tiptap/starter-kit
|
||||
If you followed step 1 and 2, you can now start your project with `npm run start` or `yarn start`, and open [http://localhost:3000](http://localhost:3000) in your favorite browser. This might be different, if you’re working with an existing project.
|
||||
|
||||
## 3. Create a new component
|
||||
To actually start using tiptap, you’ll need to add a new component to your app. Let’s call it `Tiptap` and put the following example code in `src/Tiptap.jsx`.
|
||||
To actually start using tiptap, you’ll need to create a new component in your app. Let’s call it `Tiptap` and put the following example code in `src/Tiptap.jsx`.
|
||||
|
||||
This is the fastest way to get tiptap up and running with React. It will give you a very basic version of tiptap, without any buttons. No worries, you will be able to add more functionality soon.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user