File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -103,7 +103,7 @@ function generateTestFileRow(file: MatlabTestFile): string {
103103 <tr>
104104 <td>
105105 <details>
106- <summary><b>${ statusEmoji } ${ file . name } </b></summary>
106+ <summary><b title=" ${ file . path } " >${ statusEmoji } ${ file . name } </b></summary>
107107 <ul style="list-style-type: none;">` +
108108 file . testCases . map ( tc => `<li>` + getStatusEmoji ( tc . status ) + ` ` + tc . name + `</li>` ) . join ( '\n' ) +
109109 `</ul>
@@ -139,13 +139,26 @@ function generateFailedTestRow(test: MatlabTestCase): string {
139139 <details>
140140 <summary>View details</summary>
141141 <pre>` +
142- test . diagnostics . map ( d => d . report ) . join ( '\n' ) +
142+ test . diagnostics . map ( d => formatDiagnosticReport ( d . report ) ) . join ( '\n' ) +
143143 `</pre>
144144 </details>
145145 </td>
146146 </tr>` ;
147147}
148148
149+ function formatDiagnosticReport ( report : string ) : string {
150+ // Preserve MATLAB formatting while escaping special characters
151+ return report
152+ // HTML special characters
153+ . replace ( / & / g, '&' )
154+ . replace ( / < / g, '<' )
155+ . replace ( / > / g, '>' )
156+ . replace ( / " / g, '"' )
157+ . replace ( / ' / g, ''' )
158+ . replace ( / ` / g, '`' )
159+ . trim ( ) ;
160+ }
161+
149162function getStatusEmoji ( status : MatlabTestStatus ) : string {
150163 switch ( status ) {
151164 case MatlabTestStatus . PASSED : return '✅' ;
You can’t perform that action at this time.
0 commit comments