Merge pull request #40 from jiulongw/jiulongw/hr
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)
|
||||
|
||||
@@ -229,7 +229,9 @@ def test_hn_nested_img():
|
||||
|
||||
|
||||
def test_hr():
|
||||
assert md('<hr>hr</hr>') == 'hr'
|
||||
assert md('Hello<hr>World') == 'Hello\n\n---\n\nWorld'
|
||||
assert md('Hello<hr />World') == 'Hello\n\n---\n\nWorld'
|
||||
assert md('<p>Hello</p>\n<hr>\n<p>World</p>') == 'Hello\n\n\n\n\n---\n\n\nWorld\n\n'
|
||||
|
||||
|
||||
def test_head():
|
||||
|
||||
Reference in New Issue
Block a user