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
1 changed files with 3 additions and 1 deletions

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):