Skip to content

Commit 119c4e3

Browse files
committed
Include the header size in the separator length calculation
1 parent e37d2d5 commit 119c4e3

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

src/viewModelFactories/tableViewModelFactory.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export class TableViewModelFactory {
1717
result.hasRightBorder = tableWithoutSeparator.hasRightBorder;
1818
result.header = this._rowViewModelFactory.buildRow(0, tableWithoutSeparator);
1919
result.rows = this.buildRows(tableWithoutSeparator);
20-
result.separator = this._rowViewModelFactory.buildSeparator(result.rows, tableWithoutSeparator);
20+
result.separator = this.buildSeparator(result, tableWithoutSeparator);
2121

2222
return result;
2323
}
@@ -30,4 +30,15 @@ export class TableViewModelFactory {
3030

3131
return result;
3232
}
33+
34+
private buildSeparator(tableVm: TableViewModel, table: Table) {
35+
let rowsForSeparatorCalculation: RowViewModel[] = new Array();
36+
37+
rowsForSeparatorCalculation.push(tableVm.header);
38+
for (let r of tableVm.rows) {
39+
rowsForSeparatorCalculation.push(r);
40+
}
41+
42+
return this._rowViewModelFactory.buildSeparator(rowsForSeparatorCalculation, table);
43+
}
3344
}

test/systemTests/resources/redundantTableEnding-expected.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
Type | Range | Size
2-
-------|---------------------------------------------------------|-------------------------
1+
Type | Range | SizeSizeSizeSizeSizeSizeSizeSizeSizeSizeSizeSize
2+
-------|---------------------------------------------------------|-------------------------------------------------
33
sbyte | -128 to 127 | Signed 8-bit integer
44
byte | 0 to 255 | Unsigned 8-bit integer
55
char | U+0000 to U+ffff | Unicode 16-bit character

test/systemTests/resources/redundantTableEnding-input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Type | Range| Size|
1+
Type | Range| SizeSizeSizeSizeSizeSizeSizeSizeSizeSizeSizeSize|
22
-|-|-|
33
sbyte | -128 to 127| Signed 8-bit integer|
44
byte| 0 to 255| Unsigned 8-bit integer|

0 commit comments

Comments
 (0)