]> git.openstreetmap.org Git - osqa.git/commitdiff
reverting the changes made in commit #1097 for Jira OSQA-593, it resulted another...
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 11 Aug 2011 09:52:30 +0000 (09:52 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Thu, 11 Aug 2011 09:52:30 +0000 (09:52 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1159 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/models/comment.py
forum/models/node.py

index 32fdf5dfe3596c91858e424b262548ac635023b2..45c5962813c833244f04d1709fae5fa10a3257d6 100644 (file)
@@ -17,8 +17,7 @@ class Comment(Node):
     @property
     def comment(self):
         if settings.FORM_ALLOW_MARKDOWN_IN_COMMENTS:
-           # Avoid doing double replacement of backslashes
-            return self._as_markdown_raw(self.body,'limitedsyntax')
+               return self.as_markdown('limitedsyntax')
         else:
             return self.body
 
index 6d51793517b4db408c835145a31ce53028962b97..72ef0c0737c12efa2a1b04abaa4fc18dd24660cc 100644 (file)
@@ -29,7 +29,7 @@ class NodeContent(models.Model):
         return auto_user_link(self, self._as_markdown(content, *['auto_linker']))
 
     @classmethod
-    def _as_markdown_raw(cls, content, *extensions):
+    def _as_markdown(cls, content, *extensions):
         try:
             return mark_safe(sanitize_html(markdown.markdown(content, extensions=extensions)))
         except Exception, e:
@@ -38,11 +38,6 @@ class NodeContent(models.Model):
                 str(e), cls.__name__, str(e), traceback.format_exc()))
             return ''
 
-    # Replace \ with \\ to preserve backslashes during markdown processing
-    @classmethod
-    def _as_markdown(cls, content, *extensions):
-       return cls._as_markdown_raw(content.replace('\\','\\\\'), *extensions)
-
     def as_markdown(self, *extensions):
         return self._as_markdown(self.body, *extensions)