From 88e5cdaec4ae8079637aa980386c745ce82e2aa4 Mon Sep 17 00:00:00 2001 From: Max Magorsch Date: Mon, 20 Apr 2020 17:37:54 +0200 Subject: Correctly display multi-line comments Signed-off-by: Max Magorsch --- web/packs/src/javascript/cvetool.js | 4 ++-- web/templates/glsa/edit.tmpl | 5 +---- web/templates/glsa/show.tmpl | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/web/packs/src/javascript/cvetool.js b/web/packs/src/javascript/cvetool.js index b43e806..b9a8272 100644 --- a/web/packs/src/javascript/cvetool.js +++ b/web/packs/src/javascript/cvetool.js @@ -229,7 +229,7 @@ function format ( d ) { commentsObjects.forEach(function (comment, index) { if(comment.Message != "") { var commentDate = '' + comment.Date.split("T")[0] + ' ' + comment.Date.split("T")[1].split(".")[0] + ' UTC'; - comments = comments + '
' + comment.User.Name + '
' + commentDate + '
' + escape(comment.Message) + '
'; + comments = comments + '
' + comment.User.Name + '
' + commentDate + '
' + comment.Message + '
'; } }); } @@ -454,7 +454,7 @@ function changeState(cveid, reason, newState){ // add comment var comment = JSON.parse(data); var commentDate = '' + comment.Date.split("T")[0] + ' ' + comment.Date.split("T")[1].split(".")[0] + ' UTC'; - var newComment = '
' + comment.User + '
' + commentDate + '
' + escape(comment.Message) + '
'; + var newComment = '
' + comment.User + '
' + commentDate + '
' + comment.Message + '
'; $('.comments-section[data-cveid="' + cveid + '"]').append(newComment); } diff --git a/web/templates/glsa/edit.tmpl b/web/templates/glsa/edit.tmpl index eed5c44..dcd6ed3 100644 --- a/web/templates/glsa/edit.tmpl +++ b/web/templates/glsa/edit.tmpl @@ -706,10 +706,7 @@ -
- {{if eq .Type "approve"}}Approved: {{else if eq .Type "decline"}}Declined: {{end}} - {{.Message}} -
+
{{if eq .Type "approve"}}Approved: {{else if eq .Type "decline"}}Declined: {{end}} {{.Message}}
diff --git a/web/templates/glsa/show.tmpl b/web/templates/glsa/show.tmpl index a07d471..161aa25 100644 --- a/web/templates/glsa/show.tmpl +++ b/web/templates/glsa/show.tmpl @@ -439,10 +439,7 @@ -
- {{if eq .Type "approve"}}Approved: {{else if eq .Type "decline"}}Declined: {{end}} - {{.Message}} -
+
{{if eq .Type "approve"}}Approved: {{else if eq .Type "decline"}}Declined: {{end}} {{.Message}}
-- cgit v1.2.3-65-gdbad