summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorIsrael Madueme <purelogiq@gmail.com>2018-08-10 14:57:01 +0200
committerDylan William Hardison <dylan@hardison.net>2018-08-10 14:57:01 +0200
commitfd850e00db835d2b84c59014c3b1021fea2294fc (patch)
treeb5529f9bf45bb2b8f66b19714d215f1ca6c06c94 /template
parent5a43b27f7940be9697f312c550fa2de11a9e14d7 (diff)
downloadbugzilla-fd850e00db835d2b84c59014c3b1021fea2294fc.tar.gz
bugzilla-fd850e00db835d2b84c59014c3b1021fea2294fc.tar.xz
Bug 1456878 - Support markdown comments
Diffstat (limited to 'template')
-rw-r--r--template/en/default/bug/comment.html.tmpl7
-rw-r--r--template/en/default/bug/comments.html.tmpl17
-rw-r--r--template/en/default/bug/edit.html.tmpl2
-rw-r--r--template/en/default/bug/link.html.tmpl3
-rw-r--r--template/en/default/bug/new_bug.html.tmpl2
-rw-r--r--template/en/default/email/bugmail.html.tmpl7
-rw-r--r--template/en/default/filterexceptions.pl2
-rw-r--r--template/en/default/global/header.html.tmpl1
-rw-r--r--template/en/default/pages/linked.html.tmpl4
9 files changed, 32 insertions, 13 deletions
diff --git a/template/en/default/bug/comment.html.tmpl b/template/en/default/bug/comment.html.tmpl
index e3cd382fd..9b0deecc4 100644
--- a/template/en/default/bug/comment.html.tmpl
+++ b/template/en/default/bug/comment.html.tmpl
@@ -37,6 +37,11 @@
<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 %]
+
+<div id="comment-markdown-tip">
+ <img src="extensions/BMO/web/images/notice.png" width="16" height="16">
+ <a href="https://guides.github.com/features/mastering-markdown/" target="_blank">Markdown styling now supported</a>
+</div>
diff --git a/template/en/default/bug/comments.html.tmpl b/template/en/default/bug/comments.html.tmpl
index 7af08efde..98ab4645e 100644
--- a/template/en/default/bug/comments.html.tmpl
+++ b/template/en/default/bug/comments.html.tmpl
@@ -283,15 +283,22 @@
</div>
[% END %]
-[%# Don't indent the <pre> block, since then the spaces are displayed in the
- # generated HTML
+
+[% IF comment.is_markdown %]
+ [% comment_tag = 'div' %]
+[% ELSE %]
+ [% comment_tag = 'pre' %]
+[% END %]
+
+[%# Don't indent incaase it's a <pre> block, since then the spaces are
+ # displayed in the generated HTML
#%]
-<pre class="bz_comment_text[% " collapsed" IF comment.collapsed %]"
+<[% comment_tag FILTER none %] class="bz_comment_text[% " collapsed" IF comment.collapsed %]"
[% IF mode == "edit" || comment.collapsed %]
id="comment_text_[% comment.count FILTER none %]"
[% END %]>
- [%- comment_text FILTER quoteUrls(bug, comment) -%]
-</pre>
+ [%- comment_text FILTER renderComment(bug, comment) -%]
+</[% comment_tag FILTER none %]>
[% Hook.process('a_comment-end', 'bug/comments.html.tmpl') %]
</div>
[% END %]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 445e5fe0d..69edfeb00 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -253,7 +253,7 @@
(<span id="alias_nonedit_display">[% bug.alias FILTER html %]</span>)
[% END %]
[% END %]
- <span role="heading" aria-level="1" id="short_desc_nonedit_display">[% bug.short_desc FILTER quoteUrls(bug) FILTER wbr %]</span>
+ <span role="heading" aria-level="1" id="short_desc_nonedit_display">[% bug.short_desc FILTER renderComment(bug, undef, 1) FILTER wbr %]</span>
[% IF bug.check_can_change_field('short_desc', 0, 1) ||
bug.check_can_change_field('alias', 0, 1) %]
<small class="editme">(<a href="#" id="editme_action">edit</a>)</small>
diff --git a/template/en/default/bug/link.html.tmpl b/template/en/default/bug/link.html.tmpl
index dc09848da..17b85589c 100644
--- a/template/en/default/bug/link.html.tmpl
+++ b/template/en/default/bug/link.html.tmpl
@@ -56,7 +56,8 @@
<a class="bz_bug_link
bz_status_[% bug.bug_status FILTER css_class_quote %]
- [% ' bz_closed' IF !bug.isopened %]"
+ [% ' bz_closed' IF !bug.isopened %]
+ [% ' bz_private_link' IF !user.can_see_bug(bug) %]"
title="[% link_title FILTER collapse FILTER html %]"
href="[% urlbase FILTER html IF full_url %]show_bug.cgi?id=
[%~ bug.id FILTER uri %][% anchor FILTER html %]">
diff --git a/template/en/default/bug/new_bug.html.tmpl b/template/en/default/bug/new_bug.html.tmpl
index ef5e361c0..185ae771b 100644
--- a/template/en/default/bug/new_bug.html.tmpl
+++ b/template/en/default/bug/new_bug.html.tmpl
@@ -244,7 +244,7 @@
<textarea rows="5" name="comment" id="comment" aria-labelledby="comment-edit-tab"></textarea>
</div>
<div id="comment-preview-tabpanel" class="comment-tabpanel" role="tabpanel" aria-labelledby="comment-preview-tab" style="display:none">
- <pre id="comment-preview" class="comment-text"></pre>
+ <div id="comment-preview" class="comment-text"></div>
</div>
</div>
[% END %]
diff --git a/template/en/default/email/bugmail.html.tmpl b/template/en/default/email/bugmail.html.tmpl
index 8b567b691..cdcb3d13d 100644
--- a/template/en/default/email/bugmail.html.tmpl
+++ b/template/en/default/email/bugmail.html.tmpl
@@ -38,7 +38,12 @@
on [% "$terms.bug $bug.id" FILTER bug_link(bug, { full_url => 1, user => to_user }) FILTER none %]
from [% INCLUDE global/user.html.tmpl user = to_user, who = comment.author %]</b>
[% END %]
- <pre>[% comment.body_full({ wrap => 1 }) FILTER quoteUrls(bug, comment, to_user) %]</pre>
+ [% IF comment.is_markdown %]
+ [% comment_tag = 'div' %]
+ [% ELSE %]
+ [% comment_tag = 'pre' %]
+ [% END %]
+ <[% comment_tag FILTER none %]>[% comment.body_full({ wrap => 1 }) FILTER renderComment(bug, comment) %]</[% comment_tag FILTER none %]>
</div>
[% END %]
</p>
diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl
index 39f064035..07211ad29 100644
--- a/template/en/default/filterexceptions.pl
+++ b/template/en/default/filterexceptions.pl
@@ -34,7 +34,7 @@
# [% foo.push() %]
# TT loop variables - [% loop.count %]
# Already-filtered stuff - [% wibble FILTER html %]
-# where the filter is one of html|csv|js|quoteUrls|time|uri|xml|none
+# where the filter is one of html|csv|js|renderComment|time|uri|xml|none
%::safe = (
diff --git a/template/en/default/global/header.html.tmpl b/template/en/default/global/header.html.tmpl
index bd9ec8bcb..426742495 100644
--- a/template/en/default/global/header.html.tmpl
+++ b/template/en/default/global/header.html.tmpl
@@ -112,6 +112,7 @@
},
constant => {
COMMENT_COLS => constants.COMMENT_COLS,
+ URL_BASE => urlbase,
},
string => {
# Please keep these in alphabetical order.
diff --git a/template/en/default/pages/linked.html.tmpl b/template/en/default/pages/linked.html.tmpl
index b5d850627..aa519f9ac 100644
--- a/template/en/default/pages/linked.html.tmpl
+++ b/template/en/default/pages/linked.html.tmpl
@@ -31,7 +31,7 @@
<p>
<pre class="bz_comment_text">
-[%- cgi.param("text") FILTER quoteUrls FILTER html -%]
+[%- cgi.param("text") FILTER renderComment FILTER html -%]
</pre>
</p>
@@ -46,7 +46,7 @@
<p>
<pre class="bz_comment_text">
-[%- cgi.param("text") FILTER quoteUrls -%]
+[%- cgi.param("text") FILTER renderComment -%]
</pre>
</p>