mirror of
https://github.com/not-kennethreitz/markdownplease.com.git
synced 2026-06-05 23:20:19 +00:00
Fixed issue where if type=='html' and no content the app would bork
This commit is contained in:
+15
-15
@@ -20,22 +20,22 @@ def fuck_gpl3():
|
||||
content = get_readable_content_from_url(url)
|
||||
print url
|
||||
|
||||
if type == 'html':
|
||||
print url
|
||||
markdown_url_contents = _markdown_to_html(content)
|
||||
return render_template(
|
||||
'index.html',
|
||||
converted_url_contents=markdown_url_contents,
|
||||
page_url=url,
|
||||
)
|
||||
else:
|
||||
if url:
|
||||
if content:
|
||||
return content, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}
|
||||
else:
|
||||
return '404 Not Found', 404
|
||||
if url:
|
||||
if not content:
|
||||
return '404 Not Found', 404
|
||||
|
||||
if type == 'html':
|
||||
print url
|
||||
markdown_url_contents = _markdown_to_html(content)
|
||||
return render_template(
|
||||
'index.html',
|
||||
converted_url_contents=markdown_url_contents,
|
||||
page_url=url,
|
||||
)
|
||||
else:
|
||||
return render_template('index.html')
|
||||
return content, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}
|
||||
else:
|
||||
return render_template('index.html')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user