changeset 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 13330e1836f3
children c7d75cdfea21
files gpp/comments/views.py gpp/templates/comments/markdown_preview.html
diffstat 2 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gpp/comments/views.py	Fri Nov 27 03:30:15 2009 +0000
+++ b/gpp/comments/views.py	Fri Nov 27 03:50:34 2009 +0000
@@ -14,6 +14,7 @@
 from django.views.decorators.http import require_POST
 
 from core.functions import email_admins
+from core.markup import site_markup
 from comments.forms import CommentForm
 from comments.models import Comment
 from comments.models import CommentFlag
@@ -121,6 +122,6 @@
         return HttpResponseBadRequest('No data')
 
     return render_to_response('comments/markdown_preview.html', {
-        'data': data,
+        'data': site_markup(data),
         },
         context_instance = RequestContext(request))
--- a/gpp/templates/comments/markdown_preview.html	Fri Nov 27 03:30:15 2009 +0000
+++ b/gpp/templates/comments/markdown_preview.html	Fri Nov 27 03:50:34 2009 +0000
@@ -1,5 +1,3 @@
-{% load markup %}
-{% load smiley_tags %}
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -9,6 +7,6 @@
 <title>Markdown Preview</title>
 <link rel="stylesheet" type="text/css" href="~/templates/preview.css" />
 </head>
-{{ data|smiley_markdown|markdown:"safe" }}
+{{ data|safe }}
 </body>
 </html>