MM-60425 Making clickable images work inside Markdown (#8215)

* fix: disables the gallery click on images inside a markdown link

* feat: removing the logic for acknowledging children that is inside link

* chore: renaming for consistency
This commit is contained in:
Lucas Reis 2024-10-07 16:57:26 -03:00 committed by GitHub
parent 1c299c4c7a
commit 603ea793f9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -357,11 +357,15 @@ const Markdown = ({
return null;
}
const isInsideLink = context.indexOf('link') !== -1;
const disableInteraction = (disableGallery ?? Boolean(!location)) || isInsideLink;
if (context.indexOf('table') !== -1) {
// We have enough problems rendering images as is, so just render a link inside of a table
return (
<MarkdownTableImage
disabled={disableGallery ?? Boolean(!location)}
disabled={disableInteraction}
imagesMetadata={imagesMetadata}
location={location}
postId={postId!}
@ -372,7 +376,7 @@ const Markdown = ({
return (
<MarkdownImage
disabled={disableGallery ?? Boolean(!location)}
disabled={disableInteraction}
errorTextStyle={[computeTextStyle(textStyles, baseTextStyle, context), textStyles.error]}
layoutHeight={layoutHeight}
layoutWidth={layoutWidth}
@ -407,6 +411,7 @@ const Markdown = ({
if (isUnsafeLinksPost) {
return renderText({context: [], literal: href});
}
return (
<MarkdownLink
href={href}