docs: open prerequisite links in new tab (#11701)

This commit is contained in:
Shahed Nasser
2025-03-04 09:05:38 +02:00
committed by GitHub
parent a39830e269
commit 07e39609d9
2 changed files with 5 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ export const PrerequisiteItem = ({
position === "bottom" && "rounded-tl-docs_DEFAULT rounded-bl-docs_xl",
!link && "cursor-text"
)}
target={link ? "_blank" : undefined}
rel={link ? "noopener noreferrer" : undefined}
>
{text}
{link && "↗"}

View File

@@ -39,6 +39,9 @@ export const Prerequisites = ({ items }: PrerequisitesProps) => {
<details
open={!collapsed}
onClick={(event) => {
if (event.target instanceof HTMLAnchorElement) {
return
}
event.preventDefault()
}}
onToggle={(event) => {