From 2decfc1fa25b7fe257472b1b5db5ab688831e049 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Mon, 31 Aug 2020 13:42:36 +0200 Subject: [PATCH] added title attribute to images fixes #518 --- .../replace-components/image/image-frame.tsx | 6 +++--- .../replace-components/image/image-replacer.tsx | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/components/markdown-renderer/replace-components/image/image-frame.tsx b/src/components/markdown-renderer/replace-components/image/image-frame.tsx index 4cc026142..d34bf2604 100644 --- a/src/components/markdown-renderer/replace-components/image/image-frame.tsx +++ b/src/components/markdown-renderer/replace-components/image/image-frame.tsx @@ -3,7 +3,7 @@ import { useSelector } from 'react-redux' import { getProxiedUrl } from '../../../../api/media' import { ApplicationState } from '../../../../redux' -export const ImageFrame: React.FC> = ({ alt, src, ...props }) => { +export const ImageFrame: React.FC> = ({ alt, src, title, ...props }) => { const [imageUrl, setImageUrl] = useState('') const imageProxyEnabled = useSelector((state: ApplicationState) => state.config.useImageProxy) @@ -18,11 +18,11 @@ export const ImageFrame: React.FC> = ( if (imageProxyEnabled) { return ( - {alt} + {alt} ) } return ( - {alt} + {alt} ) } diff --git a/src/components/markdown-renderer/replace-components/image/image-replacer.tsx b/src/components/markdown-renderer/replace-components/image/image-replacer.tsx index 4dd2ea8ed..09df181f7 100644 --- a/src/components/markdown-renderer/replace-components/image/image-replacer.tsx +++ b/src/components/markdown-renderer/replace-components/image/image-replacer.tsx @@ -12,6 +12,7 @@ export class ImageReplacer implements ComponentReplacer { className={node.attribs.class} src={node.attribs.src} alt={node.attribs.alt} + title={node.attribs.title} width={node.attribs.width} height={node.attribs.height} />