-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Switch from hostic dom to zeed dom (#2151)
* add zeed-dom * update zeed-dom for performance improvements
- Loading branch information
1 parent
696cfcb
commit 56a75db
Showing
4 changed files
with
19 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import { Node, DOMSerializer, Schema } from 'prosemirror-model' | ||
// @ts-ignore | ||
import { createHTMLDocument } from 'hostic-dom' | ||
import { createHTMLDocument, VHTMLDocument } from 'zeed-dom' | ||
|
||
export default function getHTMLFromFragment(doc: Node, schema: Schema): string { | ||
return DOMSerializer | ||
const document = DOMSerializer | ||
.fromSchema(schema) | ||
.serializeFragment(doc.content, { | ||
document: createHTMLDocument(), | ||
}) | ||
// @ts-ignore | ||
.render() | ||
}) as unknown as VHTMLDocument | ||
|
||
return document.render() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters