mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-23 08:47: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()
|
|
}
|