bianjiang 1 年之前
父節點
當前提交
d334dace1d
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/modules/editor/components/CompUI/basicUI/Text/component2.tsx

+ 2 - 3
src/modules/editor/components/CompUI/basicUI/Text/component2.tsx

@@ -227,10 +227,9 @@ const EditorComp = defineComponent({
             const tagReg =
               /(<(p|h2|h3)[\s\S]*?>)(<span[\s\S]*?>)?([\s\S]*?)(<\/span>)?(<\/(p|h2|h3)>)/gi;
             const blocks = comp.value.text.match(tagReg);
-            if (!blocks) {
-              return;
+            if (blocks) {
+              preTag.value = blocks[0];
             }
-            preTag.value = blocks[0];
           }
           if (!comp.value.text && preTag.value) {
             const text = value?.replace(/<[^>]+>/g, "");