mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-09 13:28:04 +08:00
8c6751f0c6
* chore: add precommit hook for eslint fixes, fix linting issues * chore: add eslint import sort plugin
13 lines
424 B
TypeScript
13 lines
424 B
TypeScript
import { Node } from 'prosemirror-model'
|
|
|
|
import { Extensions, JSONContent } from '../types'
|
|
import { getHTMLFromFragment } from './getHTMLFromFragment'
|
|
import { getSchema } from './getSchema'
|
|
|
|
export function generateHTML(doc: JSONContent, extensions: Extensions): string {
|
|
const schema = getSchema(extensions)
|
|
const contentNode = Node.fromJSON(schema, doc)
|
|
|
|
return getHTMLFromFragment(contentNode.content, schema)
|
|
}
|