From 1009087d4112ae3afe6b74fd46ba6638e3c7cdf0 Mon Sep 17 00:00:00 2001 From: chrispy Date: Sun, 29 Dec 2024 13:52:32 -0500 Subject: [PATCH] insert a blank line between table caption, table content Signed-off-by: chrispy --- markdownify/__init__.py | 2 +- tests/test_tables.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 3272ce5..cadd2bd 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -442,7 +442,7 @@ class MarkdownConverter(object): return '\n\n' + text + '\n' def convert_caption(self, el, text, convert_as_inline): - return text + '\n' + return text + '\n\n' def convert_figcaption(self, el, text, convert_as_inline): return '\n\n' + text + '\n\n' diff --git a/tests/test_tables.py b/tests/test_tables.py index fc6eee6..dcf9ad7 100644 --- a/tests/test_tables.py +++ b/tests/test_tables.py @@ -249,6 +249,6 @@ def test_table(): assert md(table_missing_text) == '\n\n| | Lastname | Age |\n| --- | --- | --- |\n| Jill | | 50 |\n| Eve | Jackson | 94 |\n\n' assert md(table_missing_head) == '\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n' assert md(table_body) == '\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n' - assert md(table_with_caption) == 'TEXT\n\nCaption\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n\n' + assert md(table_with_caption) == 'TEXT\n\nCaption\n\n| Firstname | Lastname | Age |\n| --- | --- | --- |\n\n' assert md(table_with_colspan) == '\n\n| Name | | Age |\n| --- | --- | --- |\n| Jill | Smith | 50 |\n| Eve | Jackson | 94 |\n\n' assert md(table_with_undefined_colspan) == '\n\n| Name | Age |\n| --- | --- |\n| Jill | Smith |\n\n'