mirror of
https://github.com/Ellpeck/ObsidianSimpleTimeTracker.git
synced 2024-12-18 19:39:22 +01:00
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:
parent
7aa91901c6
commit
5baf96571e
2 changed files with 5 additions and 4 deletions
|
@ -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
Loading…
Reference in a new issue