From: Kohei Yoshino Date: Thu, 29 Nov 2018 14:08:44 +0000 (-0500) Subject: Bug 1510832 - Adding a trailing space to a comment causes an error X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4e12c8ce65dd4eebfee06091924baa9e04e46e7f;p=thirdparty%2Fbugzilla.git Bug 1510832 - Adding a trailing space to a comment causes an error --- diff --git a/extensions/EditComments/web/js/inline-editor.js b/extensions/EditComments/web/js/inline-editor.js index f99bc5dda..605ab8ff8 100644 --- a/extensions/EditComments/web/js/inline-editor.js +++ b/extensions/EditComments/web/js/inline-editor.js @@ -50,13 +50,14 @@ Bugzilla.InlineCommentEditor = class InlineCommentEditor { } /** - * Check if the comment is edited. + * Check if the comment is edited. Ignore leading/trailing white space(s) and/or additional empty line(s) when + * comparing the changes. * @private * @readonly * @type {Boolean} */ get edited() { - return this.$textarea.value !== this.raw_comment; + return this.$textarea.value.trim() !== this.raw_comment.trim(); } /**