Skip to content

Commit

Permalink
fix: int in table
Browse files Browse the repository at this point in the history
  • Loading branch information
u8slvn committed Jul 1, 2020
1 parent 8b7b735 commit 3ea1d11
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.0.2 (--)

* Fix int in table

## 0.0.1 (2020-07-01)

* Add MarkdownIO basics.
Expand Down
2 changes: 1 addition & 1 deletion markdownio/block.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def _render_row(self, row: TList):
value = str(value)
width_diff = self.max_col_widths[index] - len(value)
if width_diff > 0:
row[index] += ' ' * width_diff
row[index] = str(row[index]) + ' ' * width_diff
return f'| {" | ".join(row)} |'

def render(self, buffer: StringIO):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ def test_table(document):
elem = block.Table(columns=3)
elem.set_headers(['one', 'two', 'three'])
elem.add_row(['Hello', 'World', '!'])
elem.add_row(['foo', 'bar', '64'])
elem.add_row(['foo', 'bar', 64])
document.add(elem)

expected = '| one | two | three |\n' \
Expand Down

0 comments on commit 3ea1d11

Please sign in to comment.