Skip to content

Commit

Permalink
fix(http): fix external mozilla links
Browse files Browse the repository at this point in the history
  • Loading branch information
revolunet committed Feb 20, 2025
1 parent 50a3285 commit c231dd7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions report/www/src/components/HTTP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,9 @@ const docLinks: [
],
];

const fixMozLinks = (str) =>
str.replace(/href="\/en-US/g, 'href="https://developer.mozilla.org/en-US');

const columns = [
{
name: "impact",
Expand All @@ -971,7 +974,9 @@ const columns = [
if (!docLink) return "-";
const [key, values] = docLink;
return docLink ? (
<div dangerouslySetInnerHTML={{ __html: values.description }}></div>
<div
dangerouslySetInnerHTML={{ __html: fixMozLinks(values.description) }}
></div>
) : (
"-"
);
Expand All @@ -996,7 +1001,7 @@ const columns = [
) : (
<div
dangerouslySetInnerHTML={{
__html: values.recommendation || values.description,
__html: fixMozLinks(values.recommendation || values.description),
}}
></div>
);
Expand Down

0 comments on commit c231dd7

Please sign in to comment.