Skip to content

Commit

Permalink
escape params table contents
Browse files Browse the repository at this point in the history
  • Loading branch information
camillobruni committed Jan 7, 2025
1 parent 91183e0 commit 6c6f8e2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
11 changes: 10 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,16 @@ <h2>Non-standard Parameters</h2>
Speedometer ran with non-standard parameters.<br />
The results are likely not comparable to default runs.
</p>
<table id="non-standard-params-table"></table>
<table id="non-standard-params-table">
<thead>
<tr>
<th>Param</th>
<th>Value</th>
<th>Default</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="aggregated-metric-result">
<h2>Aggregate Metric</h2>
Expand Down
19 changes: 8 additions & 11 deletions resources/main.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -306,18 +306,15 @@ class MainBenchmarkClient {
}
if (paramsDiff.length === 0)
return;
let body = "";
for (const { key, value, defaultValue } of paramsDiff)
body += `<tr><th>${key}</th><th>${value}</th><th>${defaultValue}</th></tr>`;
const body = document.createElement("tbody");
for (const { key, value, defaultValue } of paramsDiff) {
const row = body.insertRow(-1);
row.insertCell().textContent = key;
row.insertCell().textContent = value;
row.insertCell().textContent = defaultValue;
}
const table = document.getElementById("non-standard-params-table");
table.innerHTML = `<thead>
<tr>
<th>Param</th>
<th>Value</th>
<th>Default</th>
</tr>
</thead>
<tbody>${body}</tbody>`;
table.replaceChild(body, table.tBodies[0]);
document.querySelector(".non-standard-params").style.display = "block";
}

Expand Down

0 comments on commit 6c6f8e2

Please sign in to comment.