Replace line returns by <br /> for comments

This commit is contained in:
Grégory Soutadé 2013-02-09 09:12:01 +01:00
parent e795fa1af6
commit fd65e84b62
2 changed files with 2 additions and 1 deletions

View File

@ -10,4 +10,4 @@ v0.2 (09/02/2013)
** Bugs **
Escape double quotes in metas tag
Replace line returns by <br /> for comments

View File

@ -688,6 +688,7 @@ def add_comment(request, post_id, parent_id):
the_comment = request.POST['the_comment']
the_comment = the_comment.replace('<', '&lt;')
the_comment = the_comment.replace('>', '&gt;')
the_comment = the_comment.replace('\n', '<br />')
if 'mel' in request.POST:
mel = request.POST['mel'].strip()