diff --git a/markdownify/__init__.py b/markdownify/__init__.py index 0b2a620..eeaaf74 100644 --- a/markdownify/__init__.py +++ b/markdownify/__init__.py @@ -269,6 +269,9 @@ class MarkdownConverter(object): continue return '\n'.join(text_data) + def convert_hr(self, el, text, convert_as_inline): + return '\n\n---\n\n' + def markdownify(html, **options): return MarkdownConverter(**options).convert(html) diff --git a/tests/test_conversions.py b/tests/test_conversions.py index 6dcf9a6..9d25940 100644 --- a/tests/test_conversions.py +++ b/tests/test_conversions.py @@ -229,7 +229,9 @@ def test_hn_nested_img(): def test_hr(): - assert md('
hr') == 'hr' + assert md('Hello
World') == 'Hello\n\n---\n\nWorld' + assert md('Hello
World') == 'Hello\n\n---\n\nWorld' + assert md('

Hello

\n
\n

World

') == 'Hello\n\n\n\n\n---\n\n\nWorld\n\n' def test_head():