Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Return Markup instead of using |safe

  • Loading branch information...
commit 8bf498200b9734ad7a0ccd3db492178431b93419 1 parent fc67741
Martin Andrews authored
Showing with 4 additions and 4 deletions.
  1. +3 −3 rstblog/modules/disqus.py
  2. +1 −1  rstblog/templates/rst_display.html
6 rstblog/modules/disqus.py
View
@@ -15,9 +15,9 @@
:copyright: (c) 2012 by Martin Andrews.
:license: BSD, see LICENSE for more details.
"""
-from jinja2 import contextfunction
+import jinja2
-@contextfunction
+@jinja2.contextfunction
def get_disqus(context):
var_shortname=context['builder'].config.root_get('modules.disqus.shortname', 'YOUR-DISQUS-SHORTNAME')
@@ -45,7 +45,7 @@ def get_disqus(context):
if not context['config'].get('disqus', True):
disqus_txt='' # "<h1>DISQUS DEFEATED</h1>"
- return disqus_txt.encode('utf-8')
+ return jinja2.Markup(disqus_txt.encode('utf-8'))
def setup(builder):
2  rstblog/templates/rst_display.html
View
@@ -20,6 +20,6 @@
{% endif %}
{% if 'disqus' in config.active_modules %}
- {{ get_disqus()|safe }}
+ {{ get_disqus() }}
{% endif %}
{% endblock %}
Please sign in to comment.
Something went wrong with that request. Please try again.