Skip to content

Commit e7a962d

Browse files
committed
adding sanitisation
1 parent 085bed4 commit e7a962d

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

browserstack-report-action/dist/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38235,9 +38235,8 @@ class ReportProcessor {
3823538235
let addToSummaryReport = this.reportData?.report?.basicHtml;
3823638236
if (addToSummaryReport) {
3823738237
addToSummaryReport = `<html>${addToSummaryReport}</html>`;
38238-
addToSummaryReport = addToSummaryReport.replace(/[\u201C\u201D]/g, '"');
38239-
addToSummaryReport = addToSummaryReport.replace(/"(target="_blank")/g, '" $1');
38240-
addToSummaryReport = addToSummaryReport.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
38238+
addToSummaryReport = addToSummaryReport.replace(/[\u201C\u201D]/g, '"'); // Replace smart quotes with regular quotes
38239+
addToSummaryReport = addToSummaryReport.replace(/<\/?tbody>/gi, ''); // Remove tbody tags
3824138240
core.info(`Report HTML: ${addToSummaryReport}`);
3824238241
await summary.addRaw(addToSummaryReport, false);
3824338242
} else {

browserstack-report-action/src/services/ReportProcessor.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@ class ReportProcessor {
1414
let addToSummaryReport = this.reportData?.report?.basicHtml;
1515
if (addToSummaryReport) {
1616
addToSummaryReport = `<html>${addToSummaryReport}</html>`;
17-
addToSummaryReport = addToSummaryReport.replace(/[\u201C\u201D]/g, '"');
18-
addToSummaryReport = addToSummaryReport.replace(/"(target="_blank")/g, '" $1');
19-
addToSummaryReport = addToSummaryReport.replace(/&lt;/g, '<').replace(/&gt;/g, '>');
17+
addToSummaryReport = addToSummaryReport.replace(/[\u201C\u201D]/g, '"'); // Replace smart quotes with regular quotes
18+
addToSummaryReport = addToSummaryReport.replace(/<\/?tbody>/gi, ''); // Remove tbody tags
2019
core.info(`Report HTML: ${addToSummaryReport}`);
2120
await summary.addRaw(addToSummaryReport, false);
2221
} else {

0 commit comments

Comments
 (0)