Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tabulate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ def escape_empty(val):
"pretty": "pretty",
"psql": "psql",
"rst": "rst",
"github": "github",
"outline": "outline",
"simple_outline": "simple_outline",
"rounded_outline": "rounded_outline",
Expand Down
17 changes: 17 additions & 0 deletions test/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,23 @@ def test_github():
assert_equal(expected, result)


def test_github_multiline():
"Output: github with multiline cells with headers"
table = [[2, "foo\nbar"]]
headers = ("more\nspam eggs", "more spam\n& eggs")
expected = "\n".join(
[
"| more | more spam |",
"| spam eggs | & eggs |",
"|-------------|-------------|",
"| 2 | foo |",
"| | bar |",
]
)
result = tabulate(table, headers, tablefmt="github")
assert_equal(expected, result)


def test_grid():
"Output: grid with headers"
expected = "\n".join(
Expand Down