Skip to content

Commit

Permalink
Adding rel property to hyperlinks in logs (apache#41696) (apache#41783)
Browse files Browse the repository at this point in the history
* Adding rel property to hyperlinks in logs

* fixing tests

(cherry picked from commit 79db243)
  • Loading branch information
amoghrajesh authored Aug 27, 2024
1 parent 31c20f5 commit 6fe8e8f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ describe("Test Logs Utils.", () => {

const lines = parsedLogs!.split("\n");
expect(lines[lines.length - 1]).toContain(
'<a href="https://apple.com" target="_blank" style="color: blue; text-decoration: underline;">https://apple.com</a>'
'<a href="https://apple.com" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">https://apple.com</a>'
);
expect(lines[lines.length - 1]).toContain(
'<a href="https://google.com" target="_blank" style="color: blue; text-decoration: underline;">https://google.com</a>'
'<a href="https://google.com" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">https://google.com</a>'
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export const parseLogs = (
const lineWithHyperlinks = coloredLine
.replace(
urlRegex,
'<a href="$1" target="_blank" style="color: blue; text-decoration: underline;">$1</a>'
'<a href="$1" target="_blank" rel="noopener noreferrer" style="color: blue; text-decoration: underline;">$1</a>'
)
.replace(logGroupStart, (textLine) => {
const unfoldIdSuffix = "_unfold";
Expand Down

0 comments on commit 6fe8e8f

Please sign in to comment.