kosei-n 2 лет назад
Родитель
Сommit
e94d9aeb6c
1 измененных файлов с 9 добавлено и 1 удалено
  1. 9 1
      packages/editor/src/services/paste-util/paste-markdown-util.ts

+ 9 - 1
packages/editor/src/services/paste-util/paste-markdown-util.ts

@@ -35,7 +35,15 @@ export const adjustPasteData = (strFromBol: string, text: string): string => {
       return indent + line;
       return indent + line;
     });
     });
 
 
-    adjusted = replacedLines ? replacedLines.join('\n') : '';
+    if (replacedLines == null) {
+      adjusted = '';
+    }
+    else if (replacedLines.length === 1 && !matchResult) {
+      adjusted = `${replacedLines.join('')}\n`;
+    }
+    else {
+      adjusted = replacedLines.join('\n');
+    }
   }
   }
 
 
   else if (strFromBol.match(indentAndMarkRE)) {
   else if (strFromBol.match(indentAndMarkRE)) {