diff --git a/src/api/parser/src/data/post.js b/src/api/parser/src/data/post.js index 60f930bca7..a8c415a735 100644 --- a/src/api/parser/src/data/post.js +++ b/src/api/parser/src/data/post.js @@ -151,7 +151,7 @@ class Post { } // Wrap an tag on any link inside our content - article.content = linkifyHtml(article.content); + article.content = linkifyHtml(article.content, { ignoreTags: ['img'] }); let html; try { diff --git a/src/web/src/components/Posts/Post.tsx b/src/web/src/components/Posts/Post.tsx index 1e87eb2140..8536901e0b 100644 --- a/src/web/src/components/Posts/Post.tsx +++ b/src/web/src/components/Posts/Post.tsx @@ -327,13 +327,6 @@ function handleZoom(e: MouseEvent) { e.preventDefault(); zoomInImage(e.target); } - // if the user clicks an anchor with an image inside, do not open the image link in a new tab. - else if ( - e.target instanceof HTMLAnchorElement && - e.target.firstChild instanceof HTMLImageElement - ) { - e.preventDefault(); - } } const PostComponent = ({ postUrl, currentPost, totalPosts }: Props) => {