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

135426 change beginPos and endPos

soumaeda 2 лет назад
Родитель
Сommit
a30ddbbd67
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      apps/app/src/components/PageEditor/MarkdownDrawioUtil.js

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

@@ -114,7 +114,7 @@ class MarkdownDrawioUtil {
       // skip block begin sesion("``` drawio")
       this.doc(editor).lineAt(bod).number++;
       // skip block end sesion("```")
-      this.doc.lineAt(eod).number--;
+      this.doc(editor).lineAt(eod).number--;
 
       return editor.state.sliceDoc(bod, eod);
     }
@@ -131,8 +131,8 @@ class MarkdownDrawioUtil {
       endPos = this.getEod(editor);
     }
     else {
-      beginPos = this.doc(editor).lineAt(this.curPos(editor));
-      endPos = this.doc(editor).lineAt(this.curPos(editor));
+      beginPos = this.doc(editor).lineAt(this.curPos(editor)).from;
+      endPos = this.doc(editor).lineAt(this.curPos(editor)).to;
     }
 
     editor.dispatch({