diff --git a/src/components/postElements/body/view/commentBodyView.tsx b/src/components/postElements/body/view/commentBodyView.tsx index 52b518d5e..730816e4d 100644 --- a/src/components/postElements/body/view/commentBodyView.tsx +++ b/src/components/postElements/body/view/commentBodyView.tsx @@ -335,6 +335,7 @@ const CommentBody = ({ void; setSelectedImage: (imgUrl: string) => void; setSelectedLink: (url: string) => void; @@ -28,6 +27,7 @@ export const PostHtmlRenderer = memo( ({ contentWidth, body, + isComment, onLoaded, setSelectedImage, setSelectedLink, @@ -133,35 +133,42 @@ export const PostHtmlRenderer = memo( _handleOnLinkPress(data); }; - if (tnode.classes?.indexOf('markdown-video-link-youtube') >= 0) { - return ( - - ); - } - if (tnode.classes?.indexOf('markdown-video-link') >= 0) { - return ( - - ); - } - if (tnode.classes?.indexOf('markdown-video-link') >= 0) { - const imgElement = tnode.children.find((child) => { - return child.classes.indexOf('video-thumbnail') > 0 ? true : false; - }); - if (!imgElement) { - return ; + + //process video link + if(tnode.classes?.indexOf('markdown-video-link') >= 0){ + if(isComment){ + const imgElement = tnode.children.find((child) => { + return child.classes.indexOf('video-thumbnail') > 0 ? true : false; + }); + if (!imgElement) { + return ; + } + } + else if(tnode.classes?.indexOf('markdown-video-link-youtube') >= 0){ + return ( + + ); + } else { + return ( + + ); } } + return ; }; + //this method checks if image is a child of table column //and calculates img width accordingly, //returns full width if img is not part of table