Mercurial > public > sg101
comparison gpp/comments/views.py @ 136:d203a4a986d2
Markitup preview function wasn't working correctly due to the user data being escaped before going into the markdown and smiley filters.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Fri, 27 Nov 2009 03:50:34 +0000 |
parents | dbd703f7d63a |
children | 8c1832b9d815 |
comparison
equal
deleted
inserted
replaced
135:13330e1836f3 | 136:d203a4a986d2 |
---|---|
12 from django.template import RequestContext | 12 from django.template import RequestContext |
13 from django.utils.html import escape | 13 from django.utils.html import escape |
14 from django.views.decorators.http import require_POST | 14 from django.views.decorators.http import require_POST |
15 | 15 |
16 from core.functions import email_admins | 16 from core.functions import email_admins |
17 from core.markup import site_markup | |
17 from comments.forms import CommentForm | 18 from comments.forms import CommentForm |
18 from comments.models import Comment | 19 from comments.models import Comment |
19 from comments.models import CommentFlag | 20 from comments.models import CommentFlag |
20 | 21 |
21 @login_required | 22 @login_required |
119 data = request.POST.get('data', None) | 120 data = request.POST.get('data', None) |
120 if data is None: | 121 if data is None: |
121 return HttpResponseBadRequest('No data') | 122 return HttpResponseBadRequest('No data') |
122 | 123 |
123 return render_to_response('comments/markdown_preview.html', { | 124 return render_to_response('comments/markdown_preview.html', { |
124 'data': data, | 125 'data': site_markup(data), |
125 }, | 126 }, |
126 context_instance = RequestContext(request)) | 127 context_instance = RequestContext(request)) |