feat: add linkOnPaste option for adding a link to the current selection if the pasted content only contains an url, fix #1210

This commit is contained in:
Philipp Kühn
2021-05-05 09:33:52 +02:00
parent 196eb8622e
commit 9e9401e68b
2 changed files with 71 additions and 21 deletions

View File

@@ -18,10 +18,11 @@ yarn add @tiptap/extension-link
```
## Settings
| Option | Type | Default | Description |
| -------------- | --------- | ----------------------------------------------------------- | --------------------------------------------------------------------- |
| HTMLAttributes | `Object` | `{ target: '_blank', rel: 'noopener noreferrer nofollow' }` | Custom HTML attributes that should be added to the rendered HTML tag. |
| openOnClick | `Boolean` | `true` | If enabled, links will be opened on click. |
| Option | Type | Default | Description |
| -------------- | --------- | ----------------------------------------------------------- | -------------------------------------------------------------------------------- |
| HTMLAttributes | `Object` | `{ target: '_blank', rel: 'noopener noreferrer nofollow' }` | Custom HTML attributes that should be added to the rendered HTML tag. |
| openOnClick | `Boolean` | `true` | If enabled, links will be opened on click. |
| linkOnPaste | `Boolean` | `true` | Adds a link to the current selection if the pasted content only contains an url. |
## Commands
| Command | Parameters | Description |