]> git.openstreetmap.org Git - osqa.git/commitdiff
Add replacement for the markdown filter (removed in Django 1.6)
authorAttila-Mihaly Balazs <dify.ltd@gmail.com>
Wed, 15 Jan 2014 18:36:34 +0000 (20:36 +0200)
committerAttila-Mihaly Balazs <dify.ltd@gmail.com>
Wed, 15 Jan 2014 18:36:34 +0000 (20:36 +0200)
forum/skins/default/templates/question_edit_tips.html
forum/skins/default/templates/static.html
forum/skins/default/templates/users/info.html
forum/templatetags/extra_filters.py

index ea12bdde8f6cd3ebc5c10a09f6786131f6772db5..77bfa05fd7556c644e7e498c6edd2ddbbace6284 100644 (file)
@@ -1,9 +1,9 @@
 <!-- question_edit_tips.html -->
 <!-- question_edit_tips.html -->
-{% load i18n general_sidebar_tags %}
+{% load i18n general_sidebar_tags extra_filters %}
 <div class="boxC" id="title_side_bar">
     <p class="subtitle darkred">{% trans "Title Tips" %}</p>
     <div class="list-item">
 <div class="boxC" id="title_side_bar">
     <p class="subtitle darkred">{% trans "Title Tips" %}</p>
     <div class="list-item">
-        {{ settings.QUESTION_TITLE_TIPS|markdown:"settingsparser" }}
+        {{ settings.QUESTION_TITLE_TIPS|static_content:"markdown" }}
         <p class='info-box-follow-up-links'>
             <a href="{% url "faq" %}" target="_blank" title="{% trans "see frequently asked questions" %}">{% trans "faq" %} &raquo;</a>
         </p>
         <p class='info-box-follow-up-links'>
             <a href="{% url "faq" %}" target="_blank" title="{% trans "see frequently asked questions" %}">{% trans "faq" %} &raquo;</a>
         </p>
 <div class="boxC" id="tags_side_bar" align="left">
     <p class="subtitle darkred">{% trans "What Are Tags" %}</p>
     <div class="list-item">
 <div class="boxC" id="tags_side_bar" align="left">
     <p class="subtitle darkred">{% trans "What Are Tags" %}</p>
     <div class="list-item">
-        {{ settings.QUESTION_TAG_TIPS|markdown:"settingsparser" }}
+        {{ settings.QUESTION_TAG_TIPS|static_content:"markdown" }}
     </div>
 </div>
 
 
 <!-- end question_edit_tips.html  -->
     </div>
 </div>
 
 
 <!-- end question_edit_tips.html  -->
-                                  
index 87fe120db98989abc4fbc7ac8086d30f9c43f048..26819ffc714caecb69e34d9cdd908fee8d3cb42a 100644 (file)
@@ -1,11 +1,11 @@
 {% extends "base_content.html" %}
 {% extends "base_content.html" %}
-{% load i18n %}
+{% load i18n extra_filters %}
 {% block title %}{% spaceless %}{{ title }}{% endspaceless %}{% endblock %}
 
 {% block content %}
 <div class="headNormal">{{ title }}</div>
 <div class="content">
 {% block title %}{% spaceless %}{{ title }}{% endspaceless %}{% endblock %}
 
 {% block content %}
 <div class="headNormal">{{ title }}</div>
 <div class="content">
-{{ content|markdown:"settingsparser" }}
+{{ content|static_content:"markdown" }}
 </div>
 {% endblock %}
 
 </div>
 {% endblock %}
 
index 7937ea048b5cd7fa5f3765b69d29e4748b1d31d7..c7d50e51683d77b9e9ec3b9a85336c9d26e000ed 100644 (file)
             {% if not view_user.is_suspended %}
             <div class="user-about">
             {% if view_user.about %}
             {% if not view_user.is_suspended %}
             <div class="user-about">
             {% if view_user.about %}
-                {{view_user.about|markdown}}
+                {{view_user.about|static_content:"markdown-safe"}}
             {% endif %}
             </div>
             {% endif %}
             {% endif %}
             </div>
             {% endif %}
index 8dea68c9c0d4c3c944c526450ba4fcafb73064e5..01e550187414c2065c751cef49dfbf479a1605c2 100644 (file)
@@ -57,7 +57,9 @@ def contained_in(item, container):
 def static_content(content, render_mode):
     if render_mode == 'markdown':
         return mark_safe(markdown.markdown(unicode(content), ["settingsparser"]))
 def static_content(content, render_mode):
     if render_mode == 'markdown':
         return mark_safe(markdown.markdown(unicode(content), ["settingsparser"]))
+    elif render_mode == 'markdown-safe':
+        return mark_safe(markdown.markdown(unicode(content), safe_mode=True))
     elif render_mode == "html":
         return mark_safe(unicode(content))
     else:
     elif render_mode == "html":
         return mark_safe(unicode(content))
     else:
-        return unicode(content)
\ No newline at end of file
+        return unicode(content)