Skip to content

Commit ae65450

Browse files
committed
double \n formatting
1 parent cfc99c9 commit ae65450

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

src/testResultsSummary.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ function generateTestCaseRow(testCase: MatlabTestCase): string {
124124
? testCase.diagnostics.map(diagnostic =>
125125
`<details>` +
126126
`<summary>` + diagnostic.event + `</summary>` +
127-
`<p style="white-space: pre-wrap;">` + diagnostic.report + `</p>` +
127+
`<p style="white-space: pre-wrap;">` + formatDiagnosticReport(diagnostic.report) + `</p>` +
128128
`<pre style="white-space: pre-wrap;">` + diagnostic.report + `</pre>` +
129129
`</details>`
130130
).join('')
@@ -137,25 +137,25 @@ function generateTestCaseRow(testCase: MatlabTestCase): string {
137137
`</tr>`;
138138
}
139139

140-
// function formatDiagnosticReport(report: string): string {
141-
// return report
142-
// // HTML special characters
143-
// .replace(/&/g, '&amp;')
144-
// .replace(/</g, '&lt;')
145-
// .replace(/>/g, '&gt;')
146-
// .replace(/"/g, '&quot;')
147-
// .replace(/'/g, '&#039;')
148-
// .replace(/`/g, '&#096;')
149-
// // Path separators for all OS
150-
// .replace(/\\/g, '\\\\') // Windows backslash
151-
// .replace(/\//g, '/') // Unix forward slash
152-
// // Preserve MATLAB formatting
153-
// .replace(/\r\n/g, '\n') // Windows line endings
154-
// .replace(/\r/g, '\n') // Mac old-style line endings
155-
// .replace(/\t/g, ' ') // Tabs to spaces
156-
// .replace(/\n\n/g, '<br><br>')
157-
// .trim();
158-
// }
140+
function formatDiagnosticReport(report: string): string {
141+
return report
142+
// HTML special characters
143+
// .replace(/&/g, '&amp;')
144+
// .replace(/</g, '&lt;')
145+
// .replace(/>/g, '&gt;')
146+
// .replace(/"/g, '&quot;')
147+
// .replace(/'/g, '&#039;')
148+
// .replace(/`/g, '&#096;')
149+
// // Path separators for all OS
150+
// .replace(/\\/g, '\\\\') // Windows backslash
151+
// .replace(/\//g, '/') // Unix forward slash
152+
// // Preserve MATLAB formatting
153+
// .replace(/\r\n/g, '\n') // Windows line endings
154+
// .replace(/\r/g, '\n') // Mac old-style line endings
155+
// .replace(/\t/g, ' ') // Tabs to spaces
156+
.replace(/\n\n/g, '<br><br>')
157+
.trim();
158+
}
159159

160160
function getStatusEmoji(status: MatlabTestStatus): string {
161161
switch (status) {

0 commit comments

Comments
 (0)