From 962eb1d90bea4787894746b18d7645a47b8ea324 Mon Sep 17 00:00:00 2001 From: Calos Liu Date: Fri, 25 Mar 2022 01:39:24 +0800 Subject: [PATCH] Fix preceedingLineNum index Fixes #133 Fixes #130 --- src/obsidian-text-editor.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/obsidian-text-editor.ts b/src/obsidian-text-editor.ts index d4c673b..a3331aa 100644 --- a/src/obsidian-text-editor.ts +++ b/src/obsidian-text-editor.ts @@ -68,9 +68,9 @@ export class ObsidianTextEditor { // Check that the text `-tx-` is not on the line immediately preceeding the // table found in the previous check. // https://github.com/tgrosinger/advanced-tables-obsidian/issues/133 - const preceedingLineNum = table.position.start.line - 1; - if (preceedingLineNum >= 0) { - const preceedingLine = this.getLine(preceedingLineNum); + const preceedingLineIndex = table.position.start.line; + if (preceedingLineIndex >= 0) { + const preceedingLine = this.getLine(preceedingLineIndex); if (preceedingLine === '-tx-') { return false; }