diff --git a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/all-kit.tsx b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/all-kit.tsx index 874b9bc..872bcbf 100644 --- a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/all-kit.tsx +++ b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/all-kit.tsx @@ -16,6 +16,7 @@ import { DocumentChildren } from 'tiptap/core/extensions/document-children'; import { DocumentReference } from 'tiptap/core/extensions/document-reference'; import { Dropcursor } from 'tiptap/core/extensions/dropcursor'; import { Emoji } from 'tiptap/core/extensions/emoji'; +import { Flow } from 'tiptap/core/extensions/flow'; import { Focus } from 'tiptap/core/extensions/focus'; import { FontSize } from 'tiptap/core/extensions/font-size'; import { Gapcursor } from 'tiptap/core/extensions/gapcursor'; @@ -130,4 +131,5 @@ export const AllExtensions = [ DocumentWithTitle, Title, Document, + Flow, ]; diff --git a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/nodes/flow.ts b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/nodes/flow.ts new file mode 100644 index 0000000..4589efc --- /dev/null +++ b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/nodes/flow.ts @@ -0,0 +1,9 @@ +import { Node } from './node'; + +export class Flow extends Node { + type = 'flow'; + + matching() { + return this.DOMNode.nodeName === 'DIV' && this.DOMNode.classList.contains('flow'); + } +} diff --git a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/renderer.ts b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/renderer.ts index 1af16c7..bc93eb5 100644 --- a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/renderer.ts +++ b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/html-to-prosemirror/renderer.ts @@ -17,6 +17,7 @@ import { CodeBlockWrapper } from './nodes/code-block-wrapper'; import { Countdown } from './nodes/countdown'; import { DocumentChildren } from './nodes/document-children'; import { DocumentReference } from './nodes/document-reference'; +import { Flow } from './nodes/flow'; import { HardBreak } from './nodes/hard-break'; import { Heading } from './nodes/heading'; import { HorizontalRule } from './nodes/horizontal-rule'; @@ -61,6 +62,7 @@ export class Renderer { Mind, DocumentChildren, DocumentReference, + Flow, CodeBlock, CodeBlockWrapper, diff --git a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/markdown-to-html/index.ts b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/markdown-to-html/index.ts index 5f66077..5f2529d 100644 --- a/packages/client/src/tiptap/markdown/markdown-to-prosemirror/markdown-to-html/index.ts +++ b/packages/client/src/tiptap/markdown/markdown-to-prosemirror/markdown-to-html/index.ts @@ -21,6 +21,7 @@ const markdownDocumentChildren = createMarkdownContainer('documentChildren'); const markdownIframe = createMarkdownContainer('iframe'); const markdownMention = createMarkdownContainer('mention'); const markdownMind = createMarkdownContainer('mind'); +const markdownFlow = createMarkdownContainer('flow'); const markdown = markdownit('commonmark') .enable('strikethrough') @@ -42,7 +43,8 @@ const markdown = markdownit('commonmark') .use(markdownMention) .use(markdownMind) .use(markdownDocumentReference) - .use(markdownDocumentChildren); + .use(markdownDocumentChildren) + .use(markdownFlow); export const markdownToHTML = (rawMarkdown) => { return sanitize(markdown.render(rawMarkdown), {}); diff --git a/packages/client/src/tiptap/markdown/prosemirror-to-markdown/index.ts b/packages/client/src/tiptap/markdown/prosemirror-to-markdown/index.ts index 2bf73a1..91cec2c 100644 --- a/packages/client/src/tiptap/markdown/prosemirror-to-markdown/index.ts +++ b/packages/client/src/tiptap/markdown/prosemirror-to-markdown/index.ts @@ -9,6 +9,7 @@ import { CodeBlock } from 'tiptap/core/extensions/code-block'; import { Countdown } from 'tiptap/core/extensions/countdown'; import { DocumentChildren } from 'tiptap/core/extensions/document-children'; import { DocumentReference } from 'tiptap/core/extensions/document-reference'; +import { Flow } from 'tiptap/core/extensions/flow'; import { HardBreak } from 'tiptap/core/extensions/hard-break'; import { Heading } from 'tiptap/core/extensions/heading'; import { HorizontalRule } from 'tiptap/core/extensions/horizontal-rule'; @@ -125,6 +126,7 @@ const SerializerConfig = { [Countdown.name]: renderCustomContainer('countdown'), [DocumentChildren.name]: renderCustomContainer('documentChildren'), [DocumentReference.name]: renderCustomContainer('documentReference'), + [Flow.name]: renderCustomContainer('flow'), [HardBreak.name]: renderHardBreak, [Heading.name]: defaultMarkdownSerializer.nodes.heading, [HorizontalRule.name]: defaultMarkdownSerializer.nodes.horizontal_rule,