mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-24 01:17:50 +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()
|
|
}
|