Add conversion for hr element
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -307,3 +307,7 @@ def test_strong_em_symbol():
|
||||
|
||||
def test_newline_style():
|
||||
assert md('a<br />b<br />c', newline_style=BACKSLASH) == 'a\\\nb\\\nc'
|
||||
|
||||
|
||||
def test_hr():
|
||||
assert md('Hello<hr />World') == 'Hello\n\n---\n\nWorld'
|
||||
|
||||
Reference in New Issue
Block a user