From 9555e7aecff4a3d1dc5aa1ab182fdb094629c5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20Bl=C3=A4ttermann?= Date: Tue, 24 Jan 2023 14:01:00 +0100 Subject: [PATCH] Remove unnessary links (#12159) There is no need to link to the image we are already viewing and this is also considered an accessibility issue. --- website/src/components/embed.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/website/src/components/embed.js b/website/src/components/embed.js index 53f4e9184..e275077b0 100644 --- a/website/src/components/embed.js +++ b/website/src/components/embed.js @@ -88,10 +88,16 @@ const Image = ({ src, alt, title, href, ...props }) => { const markdownComponents = { code: InlineCode, p: Fragment, a: Link } return (
- - {/* eslint-disable-next-line @next/next/no-img-element */} + {href ? ( + + {/* eslint-disable-next-line @next/next/no-img-element */} + {alt} + + ) : ( + /* eslint-disable-next-line @next/next/no-img-element */ {alt} - + )} + {title && (