fix: preserve referrer for ciphera.net learn links, keep noreferrer for external
This commit is contained in:
@@ -786,12 +786,14 @@ function AuditDescription({ text }: { text: string }) {
|
|||||||
{parts.map((part, i) => {
|
{parts.map((part, i) => {
|
||||||
const match = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/)
|
const match = part.match(/^\[([^\]]+)\]\(([^)]+)\)$/)
|
||||||
if (match) {
|
if (match) {
|
||||||
|
const href = remapLearnUrl(match[2])
|
||||||
|
const isCiphera = href.startsWith('https://ciphera.net')
|
||||||
return (
|
return (
|
||||||
<a
|
<a
|
||||||
key={i}
|
key={i}
|
||||||
href={remapLearnUrl(match[2])}
|
href={href}
|
||||||
target="_blank"
|
target="_blank"
|
||||||
rel="noopener noreferrer"
|
rel={isCiphera ? 'noopener' : 'noopener noreferrer'}
|
||||||
className="text-brand-orange hover:underline"
|
className="text-brand-orange hover:underline"
|
||||||
>
|
>
|
||||||
{match[1]}
|
{match[1]}
|
||||||
|
|||||||
Reference in New Issue
Block a user