Browse Source

:bug: list render

Van 5 years ago
parent
commit
5b41a83304
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/ts/wysiwyg/input.ts

+ 2 - 1
src/ts/wysiwyg/input.ts

@@ -105,7 +105,8 @@ export const input = (event: IHTMLInputEvent, vditor: IVditor, range: Range) =>
             if (blockElement.classList.contains("vditor-wysiwyg__block")) {
                 processCodeRender(blockElement, vditor);
             }
-            blockElement.querySelectorAll(".vditor-wysiwyg__block").forEach((blockRenderItem: HTMLElement) => {
+            // TODO: 目前为全局渲染。可优化为只选取当前列表、当前列表紧邻的前后列表;最顶层列表;当前块进行渲染
+            vditor.wysiwyg.element.querySelectorAll(".vditor-wysiwyg__block").forEach((blockRenderItem: HTMLElement) => {
                 processCodeRender(blockRenderItem, vditor);
             });
         }