mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-27 11:27:49 +08:00
14 lines
372 B
TypeScript
14 lines
372 B
TypeScript
import { Node, DOMSerializer, Schema } from 'prosemirror-model'
|
|
// @ts-ignore
|
|
import { createHTMLDocument } from 'hostic-dom'
|
|
|
|
export default function getHTMLFromFragment(doc: Node, schema: Schema): string {
|
|
return DOMSerializer
|
|
.fromSchema(schema)
|
|
.serializeFragment(doc.content, {
|
|
document: createHTMLDocument(),
|
|
})
|
|
// @ts-ignore
|
|
.render()
|
|
}
|