mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-27 03:17:50 +08:00
11 lines
394 B
TypeScript
11 lines
394 B
TypeScript
import { Extensions, getSchema, JSONContent } from '@tiptap/core'
|
|
import { Node } from 'prosemirror-model'
|
|
import getHTMLFromFragment from './getHTMLFromFragment'
|
|
|
|
export default function generateHTML(doc: JSONContent, extensions: Extensions): string {
|
|
const schema = getSchema(extensions)
|
|
const contentNode = Node.fromJSON(schema, doc)
|
|
|
|
return getHTMLFromFragment(contentNode, schema)
|
|
}
|