[mod] content formatting

This commit is contained in:
asciimoo 2013-10-19 23:18:39 +02:00
parent 4e5624a507
commit b9cdad9178

View File

@ -21,6 +21,8 @@ def response(resp):
for result in search_res['responseData']['results']: for result in search_res['responseData']['results']:
url = result['originalContextUrl'] url = result['originalContextUrl']
title = result['title'] title = result['title']
content = result['content']+'<br /><a href="%s"><img src="%s" title="%s" style="max-width: 500px; "/></a>' % (result['url'], result['url'], title) content = '<a href="%s"><img src="%s" title="%s" style="max-width: 500px; "/></a>' % (result['url'], result['url'], title)
if result['content']:
content += '<br />'+result['content']
results.append({'url': url, 'title': title, 'content': content}) results.append({'url': url, 'title': title, 'content': content})
return results return results