The <junit> task from Ant 1.7.1 produced XML files where the values <property> elements could contain newline characters, e.g.: <property name="ant.core.lib" value="C:\e\i\I20110127-2034-3.7M5-clean\plugins\org.apache.ant_1.7.1.v20100518-1145\lib\ant.jar" /> <property name="line.separator" value=" " /> The <junitreport> converted this to HTML files where the value in the JavaScript had a single space instead of the line separator characters: cur['line.separator'] = ' '; This was valid JavaScript. With Ant 1.8.2, the value in the XML got properly escaped: <property name="ant.core.lib" value="C:\e\i\N20110407-2000\plugins\org.apache.ant_1.8.2.v20110117-1200\lib\ant.jar" /> <property name="line.separator" value="
" /> But now, the <junitreport> task creates JavaScript like this, which is invalid: cur['line.separator'] = ' '; cur['os.arch'] = 'x86'; => There are 2 line separators in the HTML file. Should be something like: cur['line.separator'] = '
';
Created attachment 26873 [details] HTML file with broken Properties link
It looks like the XSL stylesheets junit-frames.xsl and junit-noframes.xsl are not escaping newline characters in the javascript sections. I found this blog page that pretty much sums up the problem and remedy: http://zanstra.com/base/blog/xslt_string_escape Specifically, the stylesheets should replace 
 with \r and 
 with \n. I'll attach a patch that involves updating the JS-escape template in the stylesheet shortly.
Created attachment 27001 [details] Patch for escaping newline chars properly in junit report stylesheets The xsl files to patch are in ant/src/etc and named the same as the diffs files respectively.
Ping. Could this go into 1.8.3?
Committed revision 1199931. Please verify fix in a nightly build if you have a moment.
Looks good, thanks. Sorry for the delay. Tested with nightly build from https://builds.apache.org/view/A-F/view/Ant/job/Ant_JDK_1.4/486/artifact/trunk/build/lib/
*** Bug 55425 has been marked as a duplicate of this bug. ***