aboutsummaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-10-28 03:03:39 +0000
committerDavid Lawrence <dkl@mozilla.com>2014-10-28 03:03:39 +0000
commit3eb1f9f9c91fb630090420a8c726091f23c29263 (patch)
treec0d1aa40f6424eaf3c8020ea6805ea6c5d66a2c5 /template
parentbacbb85f219ef5924633672e61491a63ebb6f50a (diff)
downloadbugs-3eb1f9f9c91fb630090420a8c726091f23c29263.tar
bugs-3eb1f9f9c91fb630090420a8c726091f23c29263.tar.gz
bugs-3eb1f9f9c91fb630090420a8c726091f23c29263.tar.bz2
bugs-3eb1f9f9c91fb630090420a8c726091f23c29263.tar.xz
bugs-3eb1f9f9c91fb630090420a8c726091f23c29263.zip
Bug 1059684 - markdown text should not be rendered within a <pre> tag
r=glob,a=glob
Diffstat (limited to 'template')
-rw-r--r--template/en/default/bug/comment.html.tmpl9
-rw-r--r--template/en/default/bug/comments.html.tmpl4
2 files changed, 7 insertions, 6 deletions
diff --git a/template/en/default/bug/comment.html.tmpl b/template/en/default/bug/comment.html.tmpl
index b748b71fd..76054f92a 100644
--- a/template/en/default/bug/comment.html.tmpl
+++ b/template/en/default/bug/comment.html.tmpl
@@ -32,14 +32,15 @@
<div id="comment_preview" class="bz_default_hidden bz_comment">
<div id="comment_preview_loading" class="bz_default_hidden">Generating Preview...</div>
<div id="comment_preview_error" class="bz_default_hidden"></div>
- <pre id="comment_preview_text" class="bz_comment_text"></pre>
+ <div id="comment_preview_text" class="bz_comment_text"></div>
</div>
[% END %]
-[% IF feature_enabled('markdown') AND user.settings.use_markdown.value == 'on' %]
+[% IF user.use_markdown %]
<div id="comment_markdown">
- <input type="checkbox" name="use_markdown" id="use_markdown" value="1"
- [% "checked=\"checked\"" IF user.settings.use_markdown.value == 'on' %] >
+ <input type="checkbox" name="use_markdown"
+ id="use_markdown" value="1" checked="checked"
+ onchange="refresh_markdown_preview([% bug.id FILTER none %])">
<label id="use_markdown_label" for="use_markdown">Use Markdown for this [% terms.comment %]</label>
(<a href="page.cgi?id=markdown.html" target="_blank" title="View Markdown Syntax Guide">help</a>)
</div>
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 617f49471..3895691d7 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -267,12 +267,12 @@
[%# Don't indent the <pre> block, since then the spaces are displayed in the
# generated HTML
#%]
-<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]"
+<[% user.use_markdown(comment) ? "div" : "pre" %] class="bz_comment_text[% " collapsed" IF comment.collapsed %]"
[% IF mode == "edit" || comment.collapsed %]
id="comment_text_[% comment.count FILTER none %]"
[% END %]>
[%- comment_text FILTER markdown(bug, comment) -%]
-</pre>
+</[% user.use_markdown(comment) ? "div" : "pre" %]>
[% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
</div>
[% END %]