]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 657947: Add trailing newlines after quoted reply
authorByron Jones <bjones@mozilla.com>
Fri, 20 May 2011 06:49:10 +0000 (14:49 +0800)
committerByron Jones <bjones@mozilla.com>
Fri, 20 May 2011 06:49:10 +0000 (14:49 +0800)
r=dkl, a=LpSolit

js/comments.js

index d9c0f5033ab2ccaf2e4b6feea0facd311f62a2f4..f46499b62f37676ff28229957ed41aae34b2464d 100644 (file)
@@ -80,7 +80,7 @@ function expand_comment(link, comment) {
 function wrapReplyText(text) {
     // This is -3 to account for "\n> "
     var maxCol = BUGZILLA.constant.COMMENT_COLS - 3;
-    var text_lines = text.split("\n");
+    var text_lines = text.replace(/[\s\n]+$/, '').split("\n");
     var wrapped_lines = new Array();
 
     for (var i = 0; i < text_lines.length; i++) {
@@ -121,7 +121,7 @@ function wrapReplyText(text) {
         replace_lines.push(paragraph);
         wrapped_lines.push("> " + replace_lines.join("\n> "));
     }
-    return wrapped_lines.join("\n");
+    return wrapped_lines.join("\n") + "\n\n";
 }
 
 /* This way, we are sure that browsers which do not support JS