mirror of
https://github.com/docmost/docmost.git
synced 2026-05-21 09:14:07 +08:00
feat: support creating page with content
This commit is contained in:
@@ -44,6 +44,7 @@ import { generateHTML, generateJSON } from '../common/helpers/prosemirror/html';
|
||||
// see:https://github.com/ueberdosis/tiptap/issues/4089
|
||||
import { Node } from '@tiptap/pm/model';
|
||||
import * as Y from 'yjs';
|
||||
import { turndown } from '../integrations/export/turndown-utils';
|
||||
|
||||
export const tiptapExtensions = [
|
||||
StarterKit.configure({
|
||||
@@ -146,3 +147,8 @@ export function prosemirrorNodeToYElement(node: any): Y.XmlElement | Y.XmlText {
|
||||
}
|
||||
return element;
|
||||
}
|
||||
|
||||
export function jsonToMarkdown(tiptapJson: any): string {
|
||||
const html = jsonToHtml(tiptapJson);
|
||||
return turndown(html);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user