The headless rich text editor framework for web artisans.
MIT License
Bot releases are visible (Hide)
pasteRules
(#88). Now you can define some rules for transforming pasted text. For example this is helpful for linkify your text. This pasteRule is defined in the default Link
mark.import { Mark } from 'tiptap'
import { pasteRule } from 'tiptap-commands'
export default class Link extends Mark {
pasteRules({ type }) {
return [
pasteRule(
/https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_+.~#?&//=]*)/g,
type,
url => ({ href: url }),
),
]
}
}
Doc
, Paragraph
, Text
extensions in the tiptap
package. For example if you want to overwrite the default Doc
you can disable the built-in extensions with useBuiltInExtensions: false
and could use the default ones for extending.