fix(mentions): search numeric references directly in DB and avoid Tiptap duplicate 'link' extension by configuring link via StarterKit
This commit is contained in:
parent
4374b1c777
commit
e6c841383e
2 changed files with 46 additions and 36 deletions
|
|
@ -11,7 +11,6 @@ import {
|
|||
import type { ReactNode } from "react"
|
||||
import { useEditor, EditorContent } from "@tiptap/react"
|
||||
import StarterKit from "@tiptap/starter-kit"
|
||||
import Link from "@tiptap/extension-link"
|
||||
import Placeholder from "@tiptap/extension-placeholder"
|
||||
import Mention from "@tiptap/extension-mention"
|
||||
import { ReactRenderer } from "@tiptap/react"
|
||||
|
|
@ -412,12 +411,13 @@ export function RichTextEditor({
|
|||
StarterKit.configure({
|
||||
bulletList: { keepMarks: true },
|
||||
orderedList: { keepMarks: true },
|
||||
}),
|
||||
Link.configure({
|
||||
openOnClick: true,
|
||||
autolink: true,
|
||||
protocols: ["http", "https", "mailto"],
|
||||
HTMLAttributes: { rel: "noopener noreferrer", target: "_blank" },
|
||||
// Configure built-in link from StarterKit to avoid duplicate extension
|
||||
link: {
|
||||
openOnClick: true,
|
||||
autolink: true,
|
||||
protocols: ["http", "https", "mailto"],
|
||||
HTMLAttributes: { rel: "noopener noreferrer", target: "_blank" },
|
||||
},
|
||||
}),
|
||||
Placeholder.configure({ placeholder }),
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue