Bug 524763 - Regexp/string confusion in generateTextForTextNode in about:support. r=johnath,dao
authorCurtis Bartley <cbartley@mozilla.com>
Thu, 05 Nov 2009 09:03:28 +0100
changeset 33138 ca2df1029f7f4eb7936253f32759810a39be9529
parent 33137 51b506aad4b1a7bceabb9941be6e58052cfb8d2b
child 33139 74645ed304c4a2ccdfb505e2d6a6f7095e2ff4d3
push id798
push userdgottwald@mozilla.com
push dateTue, 24 Nov 2009 20:42:48 +0000
reviewersjohnath, dao
bugs524763
milestone1.9.2b4pre
Bug 524763 - Regexp/string confusion in generateTextForTextNode in about:support. r=johnath,dao
browser/base/content/aboutSupport.xhtml
--- a/browser/base/content/aboutSupport.xhtml
+++ b/browser/base/content/aboutSupport.xhtml
@@ -365,17 +365,17 @@ function generateTextForTextNode(node, i
   // If the text node is the first of a run of text nodes, then start
   // a new line and add the initial indentation.
   let prevNode = node.previousSibling;
   if (!prevNode || prevNode.nodeType == Node.TEXT_NODE)
     textFragmentAccumulator.push("\n" + indent);
 
   // Trim the text node's text content and add proper indentation after 
   // any internal line breaks.  
-  let text = node.textContent.trim().replace("\n[ \t]*", "\n" + indent);
+  let text = node.textContent.trim().replace("\n", "\n" + indent, "g");
   textFragmentAccumulator.push(text);
 }
 
 function openProfileDirectory() {
   // Get the profile directory.
   let propertiesService = Cc["@mozilla.org/file/directory_service;1"]
                             .getService(Ci.nsIProperties);
   let currProfD = propertiesService.get("ProfD", Ci.nsIFile);