soumaeda пре 2 година
родитељ
комит
10c655eaf3
1 измењених фајлова са 8 додато и 8 уклоњено
  1. 8 8
      apps/app/src/components/PageEditor/MarkdownTableUtilForEditor.ts

+ 8 - 8
apps/app/src/components/PageEditor/MarkdownTableUtilForEditor.ts

@@ -31,16 +31,16 @@ export const getBot = (editor: EditorView): number => {
   }
   }
 
 
   const doc = editor.state.doc;
   const doc = editor.state.doc;
-  const firstLineNum = 1;
+  const firstLine = 1;
   let line = doc.lineAt(curPos(editor)).number - 1;
   let line = doc.lineAt(curPos(editor)).number - 1;
-  for (; line >= firstLineNum; line--) {
+  for (; line >= firstLine; line--) {
     const strLine = doc.line(line).text;
     const strLine = doc.line(line).text;
     if (!linePartOfTableRE.test(strLine)) {
     if (!linePartOfTableRE.test(strLine)) {
       break;
       break;
     }
     }
   }
   }
-  const botLineNum = Math.max(firstLineNum, line + 1);
-  return doc.line(botLineNum).from;
+  const botLine = Math.max(firstLine, line + 1);
+  return doc.line(botLine).from;
 };
 };
 
 
 /**
 /**
@@ -53,16 +53,16 @@ export const getEot = (editor: EditorView): number => {
   }
   }
 
 
   const doc = editor.state.doc;
   const doc = editor.state.doc;
-  const lastLineNum = doc.lines;
+  const lastLine = doc.lines;
   let line = doc.lineAt(curPos(editor)).number + 1;
   let line = doc.lineAt(curPos(editor)).number + 1;
-  for (; line <= lastLineNum; line++) {
+  for (; line <= lastLine; line++) {
     const strLine = doc.line(line).text;
     const strLine = doc.line(line).text;
     if (!linePartOfTableRE.test(strLine)) {
     if (!linePartOfTableRE.test(strLine)) {
       break;
       break;
     }
     }
   }
   }
-  const eotLineNum = Math.min(line - 1, lastLineNum);
-  return doc.line(eotLineNum).to;
+  const eotLine = Math.min(line - 1, lastLine);
+  return doc.line(eotLine).to;
 };
 };
 
 
 /**
 /**