From 49d0961a6f7f585f707cd08817f3e0a9f1a19212 Mon Sep 17 00:00:00 2001 From: hernani Date: Wed, 10 Nov 2010 11:38:52 +0000 Subject: [PATCH] Applies some of the Justin Grant's patches. git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@612 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- forum/skins/default/templates/base_content.html | 8 ++++---- forum/skins/default/templates/header.html | 4 ++-- forum/skins/default/templates/node/contributors_info.html | 4 ++-- forum/skins/default/templates/sidebar/user_blocks.html | 4 ++-- forum/utils/html.py | 6 +++--- forum/views/writers.py | 1 + 6 files changed, 14 insertions(+), 13 deletions(-) diff --git a/forum/skins/default/templates/base_content.html b/forum/skins/default/templates/base_content.html index f92161e..b0ee37d 100644 --- a/forum/skins/default/templates/base_content.html +++ b/forum/skins/default/templates/base_content.html @@ -75,7 +75,7 @@ {% if settings.USE_CUSTOM_HEADER|or_preview:request %}
- {{ settings.CUSTOM_HEADER|or_preview:request|markdown:"settingsparser" }} + {{ settings.CUSTOM_HEADER|or_preview:request|safe }}
{% endif %} {% include "header.html" %} @@ -98,19 +98,19 @@ {% if settings.USE_CUSTOM_FOOTER|or_preview:request %} {% ifequal settings.CUSTOM_FOOTER_MODE|or_preview:request "above" %} {% endifequal %}
{% ifequal settings.CUSTOM_FOOTER_MODE|or_preview:request "replace" %} - {{ settings.CUSTOM_FOOTER|or_preview:request|markdown:"settingsparser" }} + {{ settings.CUSTOM_FOOTER|or_preview:request|safe }} {% else %} {% include "footer.html" %} {% endifequal %}
{% ifequal settings.CUSTOM_FOOTER_MODE|or_preview:request "below" %} {% endifequal %} {% else %} diff --git a/forum/skins/default/templates/header.html b/forum/skins/default/templates/header.html index 5e6e10f..f853916 100644 --- a/forum/skins/default/templates/header.html +++ b/forum/skins/default/templates/header.html @@ -40,8 +40,8 @@ {% if settings.USE_ANNOUNCEMENT_BAR|or_preview:request %}
- {{ settings.ANNOUNCEMENT_BAR|or_preview:request|markdown:"settingsparser" }} + {{ settings.ANNOUNCEMENT_BAR|or_preview:request|safe }}
{% endif %} - \ No newline at end of file + diff --git a/forum/skins/default/templates/node/contributors_info.html b/forum/skins/default/templates/node/contributors_info.html index 80121ea..3ed461b 100644 --- a/forum/skins/default/templates/node/contributors_info.html +++ b/forum/skins/default/templates/node/contributors_info.html @@ -1,5 +1,5 @@ {% load extra_tags %} -
+

{{ node_verb }} {% diff_date node.added_at %} @@ -9,7 +9,7 @@ {% get_score_badge node.author %}

{% if node.last_edited %} -
+

{{ node.last_edited.verb }} diff --git a/forum/skins/default/templates/sidebar/user_blocks.html b/forum/skins/default/templates/sidebar/user_blocks.html index b7fd4b2..d3d98cc 100644 --- a/forum/skins/default/templates/sidebar/user_blocks.html +++ b/forum/skins/default/templates/sidebar/user_blocks.html @@ -3,7 +3,7 @@ {% if show %} {% if wrap %}

{% endif %} -{% endif %} \ No newline at end of file +{% endif %} diff --git a/forum/utils/html.py b/forum/utils/html.py index cab52a4..6afaf62 100644 --- a/forum/utils/html.py +++ b/forum/utils/html.py @@ -1,6 +1,6 @@ """Utilities for working with HTML.""" -import html5lib -from html5lib import sanitizer, serializer, tokenizer, treebuilders, treewalkers +#import html5lib +from html5lib import sanitizer, serializer, tokenizer, treebuilders, treewalkers, HTMLParser from django.utils.html import strip_tags from forum.utils.html2text import HTML2Text from django.template import mark_safe @@ -39,7 +39,7 @@ class HTMLSanitizer(tokenizer.HTMLTokenizer, HTMLSanitizerMixin): def sanitize_html(html): """Sanitizes an HTML fragment.""" - p = html5lib.HTMLParser(tokenizer=HTMLSanitizer, + p = HTMLParser(tokenizer=HTMLSanitizer, tree=treebuilders.getTreeBuilder("dom")) dom_tree = p.parseFragment(html) walker = treewalkers.getTreeWalker("dom") diff --git a/forum/views/writers.py b/forum/views/writers.py index 07364f7..125318b 100644 --- a/forum/views/writers.py +++ b/forum/views/writers.py @@ -107,6 +107,7 @@ def ask(request): return render_to_response('ask.html', { 'form' : form, + 'tab' : 'ask' }, context_instance=RequestContext(request)) def edit_question(request, id): -- 2.39.5