feat: add tiptap table extension

This commit is contained in:
Jiang Feng
2025-04-27 10:39:02 +08:00
parent d77d3484c4
commit 741e2f0e62
10 changed files with 154 additions and 43 deletions

View File

@@ -22,6 +22,10 @@ import {
Youtube,
} from "novel";
import { Markdown } from "tiptap-markdown";
import { Table } from "@tiptap/extension-table";
import { TableHeader } from "@tiptap/extension-table-header";
import { TableRow } from "@tiptap/extension-table-row";
import { TableCell } from "@tiptap/extension-table-cell";
import { cx } from "class-variance-authority";
import { common, createLowlight } from "lowlight";
@@ -143,6 +147,11 @@ const mathematics = Mathematics.configure({
const characterCount = CharacterCount.configure();
const table = Table.configure();
const tableRow = TableRow.configure();
const tableCell = TableCell.configure();
const tableHeader = TableHeader.configure();
const markdownExtension = Markdown.configure({
html: true,
tightLists: true,
@@ -163,6 +172,10 @@ export const defaultExtensions = [
updatedImage,
taskList,
taskItem,
table,
tableRow,
tableCell,
tableHeader,
horizontalRule,
aiHighlight,
codeBlockLowlight,