Commit ba2223a
resolve "Can't find a Block to remove" error in renderFromHTML (codex-team#2941)
* fix(blocks):Error occurred when calling renderFromHTML: Can't find a Block to remove.
* fix: resolve "Can't find a Block to remove" error in renderFromHTML
- Make renderFromHTML async and await BlockManager.clear() to prevent race condition
- Change removeBlock order: remove from array before destroy to prevent index invalidation
- Fix clear() method to copy blocks array before iteration to avoid modification during loop
Fixes issue where renderFromHTML would fail with "Can't find a Block to remove" error
due to concurrent block removal operations and array modification during iteration.
Resolves codex-team#25181 parent aac8469 commit ba2223a
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
| 227 | + | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
538 | | - | |
539 | 538 | | |
| 539 | + | |
540 | 540 | | |
541 | 541 | | |
542 | 542 | | |
| |||
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
901 | | - | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
902 | 905 | | |
903 | 906 | | |
904 | 907 | | |
| |||
0 commit comments