mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-28 15:49:23 +08:00
11 lines
368 B
TypeScript
11 lines
368 B
TypeScript
import { Extensions, getSchema } from '@tiptap/core'
|
|
import { Node } from 'prosemirror-model'
|
|
import getHTMLFromFragment from './getHTMLFromFragment'
|
|
|
|
export function generateHTML(doc: object, extensions: Extensions): string {
|
|
const schema = getSchema(extensions)
|
|
const contentNode = Node.fromJSON(schema, doc)
|
|
|
|
return getHTMLFromFragment(contentNode, schema)
|
|
}
|