in inline contexts, resolve <br/> to a space instead of an empty string (#202)
Signed-off-by: chrispy <chrispy@synopsys.com>
This commit is contained in:
committed by
GitHub
parent
5122c973c1
commit
618747c18c
@@ -443,7 +443,7 @@ class MarkdownConverter(object):
|
||||
|
||||
def convert_br(self, el, text, parent_tags):
|
||||
if '_inline' in parent_tags:
|
||||
return ""
|
||||
return ' '
|
||||
|
||||
if self.options['newline_style'].lower() == BACKSLASH:
|
||||
return '\\\n'
|
||||
|
||||
@@ -79,6 +79,8 @@ def test_blockquote_nested():
|
||||
def test_br():
|
||||
assert md('a<br />b<br />c') == 'a \nb \nc'
|
||||
assert md('a<br />b<br />c', newline_style=BACKSLASH) == 'a\\\nb\\\nc'
|
||||
assert md('<h1>foo<br />bar</h1>', heading_style=ATX) == '\n\n# foo bar\n\n'
|
||||
assert md('<td>foo<br />bar</td>', heading_style=ATX) == ' foo bar |'
|
||||
|
||||
|
||||
def test_code():
|
||||
|
||||
Reference in New Issue
Block a user