mirror of
https://github.com/ueberdosis/tiptap.git
synced 2025-01-09 13:28:04 +08:00
e07a5b625d
* use named exports instead of default exports * fix tests Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
12 lines
423 B
TypeScript
12 lines
423 B
TypeScript
import { Node } from 'prosemirror-model'
|
|
import { getSchema } from './getSchema'
|
|
import { getHTMLFromFragment } from './getHTMLFromFragment'
|
|
import { Extensions, JSONContent } from '../types'
|
|
|
|
export function generateHTML(doc: JSONContent, extensions: Extensions): string {
|
|
const schema = getSchema(extensions)
|
|
const contentNode = Node.fromJSON(schema, doc)
|
|
|
|
return getHTMLFromFragment(contentNode.content, schema)
|
|
}
|