tiptap/packages/html/index.ts
Philipp Kühn 2c5b6abfaf fix bug
2020-09-10 00:11:07 +02:00

11 lines
376 B
TypeScript

import { Extensions, getSchema } from '@tiptap/core'
import { Node } from 'prosemirror-model'
import getHtmlFromFragment from './getHtmlFromFragment'
export default function generateHtml(doc: object, extensions: Extensions): string {
const schema = getSchema(extensions)
const contentNode = Node.fromJSON(schema, doc)
return getHtmlFromFragment(contentNode, schema)
}