Remove extra lines

main
Bob Mottram 2022-06-28 10:18:42 +01:00
parent 86783c1072
commit 9148ac458f
2 changed files with 9 additions and 5 deletions

View File

@ -389,4 +389,8 @@ def markdown_to_html(markdown: str) -> str:
html_str = html_str.replace('<code><br>', '<code>')
html_str = html_str.replace('</code><br>', '</code>')
html_str = html_str.replace('<ul class="md_list"><br>',
'<ul class="md_list">')
html_str = html_str.replace('</li><br>', '</li>')
return html_str

View File

@ -5737,8 +5737,8 @@ def _test_markdown_to_html():
result = markdown_to_html(markdown)
expected = \
'This is a list of points:<br>\n<ul class="md_list">' + \
'<br>\n<li>Point 1</li><br>\n' + \
'<li>Point 2</li><br>\n<li></li><br>\n</ul><br>\n' + \
'\n<li>Point 1</li>\n' + \
'<li>Point 2</li>\n<li></li>\n</ul><br>\n' + \
'And some other text.<br>\n'
if result != expected:
print(result)
@ -5750,9 +5750,9 @@ def _test_markdown_to_html():
'And some other text.'
result = markdown_to_html(markdown)
expected = \
'This is a list of points:<br>\n<ul class="md_list"><br>\n' + \
'<li><b>Point 1</b></li><br>\n' + \
'<li><i>Point 2</i></li><br>\n<li></li><br>\n</ul><br>\n' + \
'This is a list of points:<br>\n<ul class="md_list">\n' + \
'<li><b>Point 1</b></li>\n' + \
'<li><i>Point 2</i></li>\n<li></li>\n</ul><br>\n' + \
'And some other text.<br>\n'
if result != expected:
print(result)