mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-12-29 04:27:49 +08:00
e07a5b625d
* use named exports instead of default exports * fix tests Co-authored-by: Philipp Kühn <philippkuehn@MacBook-Pro-von-Philipp.local>
13 lines
397 B
TypeScript
13 lines
397 B
TypeScript
import { Node, DOMSerializer, Schema } from 'prosemirror-model'
|
|
import { createHTMLDocument, VHTMLDocument } from 'zeed-dom'
|
|
|
|
export function getHTMLFromFragment(doc: Node, schema: Schema): string {
|
|
const document = DOMSerializer
|
|
.fromSchema(schema)
|
|
.serializeFragment(doc.content, {
|
|
document: createHTMLDocument(),
|
|
}) as unknown as VHTMLDocument
|
|
|
|
return document.render()
|
|
}
|