Procházet zdrojové kódy

134432 remove extra change

soumaeda před 2 roky
rodič
revize
4291a4c28c

+ 3 - 3
apps/app/src/components/PageEditor/MarkdownTableUtil.js

@@ -39,7 +39,7 @@ class MarkdownTableUtil {
 
     const doc = editor.state.doc;
     const firstLine = doc.line(1);
-    let line = doc.lineAt(this.curPos(editor)).number - 1;
+    let line = doc.lineAt(this.curPos(editor)).number;
     for (; line >= firstLine.number; line--) {
       const strLine = doc.line(line);
       if (!this.linePartOfTableRE.test(strLine.text)) {
@@ -61,7 +61,7 @@ class MarkdownTableUtil {
 
     const doc = editor.state.doc;
     const lastLine = doc.line(doc.lines);
-    let line = doc.lineAt(this.curPos(editor)).number + 1;
+    let line = doc.lineAt(this.curPos(editor)).number;
     for (; line <= lastLine.number; line++) {
       const strLine = doc.line(line);
       if (!this.linePartOfTableRE.test(strLine.text)) {
@@ -92,7 +92,7 @@ class MarkdownTableUtil {
    */
   getMarkdownTable(editor) {
     if (!this.isInTable(editor)) {
-      return;
+      return null;
     }
 
     const strFromBotToEot = editor.state.sliceDoc(this.getBot(editor), this.getEot(editor));