* refactor: upgrade prosemirror packages to new typescript versions * refactor: migrate to new typings from prosemirror * style: fix linting issues * style: fix linting issues * style: fix linting issues * fix(ci): fix build process by reimplement filterTransaction * fix(extension-test): fix broken build because of wrong output file names * fix: fix prosemirror-tables not being bundled correctly for ES6 * fix: move to prosemirror-tables-contently until es6 build is working * fix: fix tests for youtube * fix: fix youtube test * fix(demos): fix demos build
13 lines
422 B
TypeScript
13 lines
422 B
TypeScript
import { DOMSerializer, Node, 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 Document),
|
|
}) as unknown as VHTMLDocument
|
|
|
|
return document.render()
|
|
}
|