Commit 44da5fa
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.
Refactors shared logic (text processing, attr building, element
node processing) into toRedactorHelpers.ts so both sync and async
versions are thin recursive shells with no duplicated code.
The existing sync jsonToHtml behavior is unchanged.
New types: IJsonToHtmlAsyncElementTags, IJsonToHtmlAsyncOptions.1 parent 945d23c commit 44da5fa
6 files changed
Lines changed: 747 additions & 402 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
0 commit comments