From b6777c92daf6e2becfb0efb3316a05885ce18109 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 23 Dec 2017 11:27:23 +0100 Subject: strip carriage returns when displaying comments (messes with pre-line) --- public/assets/js/lib/views/details/commentform.js | 16 ++++++++-------- public/assets/js/util/format.js | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/public/assets/js/lib/views/details/commentform.js b/public/assets/js/lib/views/details/commentform.js index a14caa3..db08ef1 100644 --- a/public/assets/js/lib/views/details/commentform.js +++ b/public/assets/js/lib/views/details/commentform.js @@ -1,32 +1,32 @@ var CommentForm = FormView.extend({ - + el: "#comment_form", - + events: { "focus textarea": 'focus', "mouseup input[type=file]": 'focus', }, - + action: "", - + initialize: function(){ this.__super__.initialize.call(this) this.template = this.$(".template").html() this.$comment = this.$("[name=comment]") }, - + load: function(thread){ this.action = "/api/thread/" + thread.id + "/comment" if (thread.settings.noupload) { this.$("[type=file]").hide() } }, - + focus: function(){ this.$el.addClass('focused') $("[name=comment]").prop("required", false) }, - + validate: function(){ var errors = [] var comment = $("[name=comment]").val() @@ -40,4 +40,4 @@ var CommentForm = FormView.extend({ success: function(){ window.location.reload() } -}) \ No newline at end of file +}) diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 7032305..4115c47 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -223,7 +223,7 @@ function tidy_urls (s, short_urls) { return '' + url + '' } }); - }).join("\n") + }).join("\n").replace(/\r/g, "") return ret } function get_domain(url){ -- cgit v1.2.3-70-g09d2