Fixed Copy to Table feature to start and end with | character in each row and be compatible with other plugins like Advanced Tables (#13)

This commit is contained in:
Pedro J 2023-05-23 16:48:18 +02:00 committed by GitHub
parent 7aa91901c6
commit 5baf96571e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View file

@ -230,12 +230,12 @@ function createMarkdownTable(tracker: Tracker, settings: SimpleTimeTrackerSettin
for (let r = 0; r < table.length; r++) {
// add separators after first row
if (r == 1)
ret += Array.from(Array(4).keys()).map(i => "-".repeat(widths[i])).join(" | ") + "\n";
ret += "| " + Array.from(Array(4).keys()).map(i => "-".repeat(widths[i])).join(" | ") + " |\n";
let row: string[] = [];
for (let i = 0; i < 4; i++)
row.push(table[r][i].padEnd(widths[i], " "));
ret += row.join(" | ") + "\n";
ret += "| " + row.join(" | ") + " |\n";
}
return ret;
}

File diff suppressed because one or more lines are too long