Merge branch 'main' of github.com:ueberdosis/tiptap

This commit is contained in:
Hans Pagel
2021-10-14 00:14:05 +02:00
141 changed files with 3352 additions and 1379 deletions

View File

@@ -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,
}),
]
},
})

View File

@@ -102,7 +102,7 @@ const CustomBold = Bold.extend({
new Editor({
extensions: [
// …
CustomBold(),
CustomBold,
],
})
```

View File

@@ -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 youre working with an existing project.
## 3. Create a new component
To actually start using tiptap, youll need to add a new component to your app. Lets call it `Tiptap` and put the following example code in `src/Tiptap.jsx`.
To actually start using tiptap, youll need to create a new component in your app. Lets 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.