]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1510832 - Adding a trailing space to a comment causes an error
authorKohei Yoshino <kohei.yoshino@gmail.com>
Thu, 29 Nov 2018 14:08:44 +0000 (09:08 -0500)
committerGitHub <noreply@github.com>
Thu, 29 Nov 2018 14:08:44 +0000 (09:08 -0500)
extensions/EditComments/web/js/inline-editor.js

index f99bc5dda815659e1275c6edb987e3eb664b4d1e..605ab8ff8cc2a5d031f5a4e17f16b81ea33280a9 100644 (file)
@@ -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();
   }
 
   /**