mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-10 18:10:08 +00:00
Add Markdown table support to the Note node (#2072)
This commit is contained in:
@@ -197,6 +197,21 @@ body {
|
||||
padding: 0.5em;
|
||||
}
|
||||
|
||||
.comfy-markdown .tiptap table {
|
||||
border-collapse: collapse;
|
||||
}
|
||||
|
||||
.comfy-markdown .tiptap th {
|
||||
text-align: left;
|
||||
background: var(--comfy-menu-bg);
|
||||
}
|
||||
|
||||
.comfy-markdown .tiptap th,
|
||||
.comfy-markdown .tiptap td {
|
||||
padding: 0.5em;
|
||||
border: thin solid;
|
||||
}
|
||||
|
||||
.comfy-modal {
|
||||
display: none; /* Hidden by default */
|
||||
position: fixed; /* Stay in place */
|
||||
|
||||
@@ -11,6 +11,10 @@ import { Editor as TiptapEditor } from '@tiptap/core'
|
||||
import TiptapStarterKit from '@tiptap/starter-kit'
|
||||
import { Markdown as TiptapMarkdown } from 'tiptap-markdown'
|
||||
import TiptapLink from '@tiptap/extension-link'
|
||||
import TiptapTable from '@tiptap/extension-table'
|
||||
import TiptapTableCell from '@tiptap/extension-table-cell'
|
||||
import TiptapTableHeader from '@tiptap/extension-table-header'
|
||||
import TiptapTableRow from '@tiptap/extension-table-row'
|
||||
|
||||
export type ComfyWidgetConstructor = (
|
||||
node: LGraphNode,
|
||||
@@ -373,7 +377,15 @@ function addMarkdownWidget(node, name: string, opts, app: ComfyApp) {
|
||||
transformPastedText: true
|
||||
})
|
||||
const editor = new TiptapEditor({
|
||||
extensions: [TiptapStarterKit, TiptapMarkdown, TiptapLink],
|
||||
extensions: [
|
||||
TiptapStarterKit,
|
||||
TiptapMarkdown,
|
||||
TiptapLink,
|
||||
TiptapTable,
|
||||
TiptapTableCell,
|
||||
TiptapTableHeader,
|
||||
TiptapTableRow
|
||||
],
|
||||
content: opts.defaultVal,
|
||||
editable: false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user