feat: render URLs as links in card description (#93)

This commit is contained in:
Henry
2025-06-21 23:15:07 +01:00
committed by GitHub
parent 500fe8af95
commit 014fdbb7d8
3 changed files with 32 additions and 0 deletions

View File

@@ -5,6 +5,7 @@ import type {
} from "@tiptap/suggestion";
import type { Instance as TippyInstance } from "tippy.js";
import { Button } from "@headlessui/react";
import Link from "@tiptap/extension-link";
import Placeholder from "@tiptap/extension-placeholder";
import {
BubbleMenu,
@@ -299,6 +300,16 @@ export default function Editor({
? ""
: "Add description... (type '/' to open commands)",
}),
Link.configure({
openOnClick: true,
HTMLAttributes: {
class: "text-blue-600 hover:text-blue-800 underline cursor-pointer",
target: "_blank",
rel: "noopener noreferrer",
},
validate: (href) => /^https?:\/\//.test(href),
autolink: true,
}),
SlashCommands.configure({
commandItems: CommandItems,
suggestion: {