README: don't add empty pre tag for empty readme

This commit is contained in:
Drew DeVault 2020-09-22 13:02:15 -04:00
parent 96544a5d62
commit a6579ef7f5

View file

@ -23,8 +23,10 @@ def format_readme(content, filename="", link_prefix=None):
if ext in markdown_exts:
html = markdown(content,
link_prefix=link_prefix)
else:
elif content:
html = f"<pre>{escape(content)}</pre>"
else:
html = ""
return Markup(html)
def try_html_readme(session, prefix, user, repo_name):