mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-19 22:00:25 +08:00
12 lines
402 B
TypeScript
12 lines
402 B
TypeScript
import getSchema from '@tiptap/core'
|
|
import getHtmlFromFragment from './getHtmlFromFragment'
|
|
import { Node } from 'prosemirror-model'
|
|
import { Extensions } from '@tiptap/core'
|
|
|
|
export default function generateHtml(doc: object, extensions: Extensions): string {
|
|
const schema = getSchema(extensions)
|
|
const contentNode = Node.fromJSON(schema, doc)
|
|
|
|
return getHtmlFromFragment(contentNode, schema)
|
|
}
|