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