Skip to content

Commit 6cbbd2d

Browse files
committed
feat: add jsonToHtmlAsync for async customElementTypes support
Add toRedactorAsync (exported as jsonToHtmlAsync) that supports customElementTypes handlers returning string | Promise<string>. Enables dynamic component resolution (e.g. await import()) before serialization. Children are resolved via Promise.all concurrently. The existing sync jsonToHtml is unchanged — fully backward compatible. New types: IJsonToHtmlAsyncElementTags, IJsonToHtmlAsyncOptions.
1 parent 945d23c commit 6cbbd2d

4 files changed

Lines changed: 682 additions & 1 deletion

File tree

src/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import "array-flat-polyfill"
22
import { fromRedactor } from "./fromRedactor"
33
import { toRedactor } from "./toRedactor"
4+
import { toRedactorAsync } from "./toRedactorAsync"
45
import {jsonToMarkdownSerializer} from './jsonToMarkdown'
56
export * from "./types"
6-
export { fromRedactor as htmlToJson, toRedactor as jsonToHtml, jsonToMarkdownSerializer as jsonToMarkdown }
7+
export { fromRedactor as htmlToJson, toRedactor as jsonToHtml, toRedactorAsync as jsonToHtmlAsync, jsonToMarkdownSerializer as jsonToMarkdown }

0 commit comments

Comments
 (0)