Просмотр исходного кода

remove unnecessary conditional branches

kosei-n 2 лет назад
Родитель
Сommit
cd561d9c52

+ 1 - 3
packages/editor/src/components/CodeMirrorEditor/CodeMirrorEditor.tsx

@@ -87,9 +87,7 @@ export const CodeMirrorEditor = (props: Props): JSX.Element => {
 
         const adjusted = adjustPasteData(strFromBol, textData);
 
-        if (adjusted != null) {
-          codeMirrorEditor?.replaceText(adjusted);
-        }
+        codeMirrorEditor?.replaceText(adjusted);
       }
     };
 

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

@@ -15,7 +15,7 @@ export const getStrFromBol = (editor: EditorView): string => {
 
 export const adjustPasteData = (indentAndMark: string, text: string): string => {
 
-  let adjusted = '';
+  let adjusted;
 
   if (text.match(indentAndMarkRE)) {
     const matchResult = indentAndMark.match(indentAndMarkRE);