aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-server/src
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2014-06-04 14:21:12 +0600
committerStas Vilchik <vilchiks@gmail.com>2014-06-04 14:21:12 +0600
commit6b66aa3eb6ff94d206090128a31acf8a264cec06 (patch)
tree30f5e8eb2077cf02c45d4b1c0ca7cd3a0d637f40 /sonar-server/src
parentca4f0a47bc7e60bbcc74f05e495cad95eaee7a09 (diff)
downloadsonarqube-6b66aa3eb6ff94d206090128a31acf8a264cec06.tar.gz
sonarqube-6b66aa3eb6ff94d206090128a31acf8a264cec06.zip
SONAR-5209 Fix issue comments
Diffstat (limited to 'sonar-server/src')
-rw-r--r--sonar-server/src/main/hbs/issues/comment-form.hbs2
-rw-r--r--sonar-server/src/main/hbs/issues/issue.hbs4
-rw-r--r--sonar-server/src/main/js/common/handlebars-extensions.js11
3 files changed, 14 insertions, 3 deletions
diff --git a/sonar-server/src/main/hbs/issues/comment-form.hbs b/sonar-server/src/main/hbs/issues/comment-form.hbs
index f517dfd5ac8..a431ea98daa 100644
--- a/sonar-server/src/main/hbs/issues/comment-form.hbs
+++ b/sonar-server/src/main/hbs/issues/comment-form.hbs
@@ -1,7 +1,7 @@
<table class="width100">
<tr>
<td style="vertical-align:top" colspan="2">
- <textarea id="issue-comment-text" rows="4" name="text" style="width: 100%">{{raw}}</textarea>
+ <textarea id="issue-comment-text" rows="4" name="text" style="width: 100%">{{show raw markdown}}</textarea>
</td>
</tr>
<tr>
diff --git a/sonar-server/src/main/hbs/issues/issue.hbs b/sonar-server/src/main/hbs/issues/issue.hbs
index cca057a77dd..2cdc3db10bd 100644
--- a/sonar-server/src/main/hbs/issues/issue.hbs
+++ b/sonar-server/src/main/hbs/issues/issue.hbs
@@ -132,10 +132,10 @@
&nbsp;&nbsp;
<a class="link-action issue-comment-edit">{{t 'edit'}}</a>&nbsp;
<a class="link-action link-red spacer-right issue-comment-delete"
- data-confirm-msg="<%= h message('issue.comment.delete_confirm_message') -%>">{{t 'delete'}}</a>
+ data-confirm-msg="{{t 'issue.comment.delete_confirm_message'}}">{{t 'delete'}}</a>
{{/if}}
</h4>
- {{{html}}}
+ {{{show html htmlText}}}
</div>
{{/each}}
</div>
diff --git a/sonar-server/src/main/js/common/handlebars-extensions.js b/sonar-server/src/main/js/common/handlebars-extensions.js
index b893a35a513..b088af5e282 100644
--- a/sonar-server/src/main/js/common/handlebars-extensions.js
+++ b/sonar-server/src/main/js/common/handlebars-extensions.js
@@ -61,6 +61,17 @@ define(['handlebars', 'moment'], function (Handlebars, moment) {
return value != null ? value : defaultValue;
});
+ Handlebars.registerHelper('show', function() {
+ var args = Array.prototype.slice.call(arguments),
+ ret = null;
+ args.forEach(function(arg) {
+ if (arg != null && ret == null) {
+ ret = arg;
+ }
+ });
+ return ret;
+ });
+
Handlebars.registerHelper('percent', function(value, total) {
return '' + ((value || 0) / total * 100) + '%';
});