html for urls

This commit is contained in:
Kenneth Reitz
2013-10-02 22:15:26 -04:00
parent 5fc456ded9
commit ab803011cd
+3
View File
@@ -171,12 +171,15 @@ def archive():
q = request.args.get('q')
text = 'text' in request.args
html = 'html' in request.args
if not q:
abort(404)
url = URL.get_or_store(q)
if html:
return url.html
if text:
return url.text, 200, {'Content-Type': 'text/x-markdown; charset=UTF-8'}