Skip to content

Commit 680f096

Browse files
Copilotfedejeanne
andcommitted
Fix JUnit HTML reports to preserve whitespace in failure messages
- Add `white-space: pre-wrap` CSS rule for `code` elements so spaces and newlines are preserved in browser rendering - Wrap @message output in a `<code>` element so the failure message text also benefits from the whitespace preservation CSS rule Fixes: #3723 Agent-Logs-Url: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/sessions/70ecfbb4-6cee-4f8f-a49b-c8496722fff2 Co-authored-by: Federico Jeanne <Federico.Jeanne@vector.com>
1 parent a7bcdee commit 680f096

File tree

1 file changed

+4
-1
lines changed
  • products/eclipse-junit-tests/src/main/scripts

1 file changed

+4
-1
lines changed

products/eclipse-junit-tests/src/main/scripts/JUNIT.XSL

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,9 @@
9797
.Properties {
9898
text-align:right;
9999
}
100+
code {
101+
white-space: pre-wrap;
102+
}
100103
</style>
101104
<script type="text/javascript" language="JavaScript">
102105
var TestCases = new Array();
@@ -572,7 +575,7 @@
572575
<xsl:choose>
573576
<xsl:when test="not(@message)">N/A</xsl:when>
574577
<xsl:otherwise>
575-
<xsl:value-of select="@message"/>
578+
<code><xsl:value-of select="@message"/></code>
576579
</xsl:otherwise>
577580
</xsl:choose>
578581
<!-- display the stacktrace -->

0 commit comments

Comments
 (0)