Skip to content

Commit 9339571

Browse files
authored
Merge pull request #167 from chrispy-snps/chrispy/table-caption-blank-line
insert a blank line between table caption, table content
2 parents 5bc3059 + 1009087 commit 9339571

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

Diff for: markdownify/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ def convert_table(self, el, text, convert_as_inline):
444444
return '\n\n' + text + '\n'
445445

446446
def convert_caption(self, el, text, convert_as_inline):
447-
return text + '\n'
447+
return text + '\n\n'
448448

449449
def convert_figcaption(self, el, text, convert_as_inline):
450450
return '\n\n' + text + '\n\n'

Diff for: tests/test_tables.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,6 @@ def test_table():
249249
assert md(table_missing_text) == '\n\n| | Lastname | Age |\n| --- | --- | --- |\n| Jill | | 50 |\n| Eve | Jackson | 94 |\n\n'
250250
assert md(table_missing_head) == '\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n'
251251
assert md(table_body) == '\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n'
252-
assert md(table_with_caption) == 'TEXT\n\nCaption\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n\n'
252+
assert md(table_with_caption) == 'TEXT\n\nCaption\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n\n'
253253
assert md(table_with_colspan) == '\n\n| Name | | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n'
254254
assert md(table_with_undefined_colspan) == '\n\n| Name | Age |\n| --- | --- |\n| Jill | Smith |\n\n'

0 commit comments

Comments
 (0)