mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2024-11-22 09:46:30 -05:00
parent
84df2ea1cf
commit
2decfc1fa2
2 changed files with 4 additions and 3 deletions
|
@ -3,7 +3,7 @@ import { useSelector } from 'react-redux'
|
|||
import { getProxiedUrl } from '../../../../api/media'
|
||||
import { ApplicationState } from '../../../../redux'
|
||||
|
||||
export const ImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = ({ alt, src, ...props }) => {
|
||||
export const ImageFrame: React.FC<React.ImgHTMLAttributes<HTMLImageElement>> = ({ 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<React.ImgHTMLAttributes<HTMLImageElement>> = (
|
|||
|
||||
if (imageProxyEnabled) {
|
||||
return (
|
||||
<img alt={alt} src={imageUrl} {...props}/>
|
||||
<img alt={alt} src={imageUrl} title={title ?? ''} {...props}/>
|
||||
)
|
||||
}
|
||||
|
||||
return (
|
||||
<img alt={alt} src={src ?? ''} {...props}/>
|
||||
<img alt={alt} src={src ?? ''} title={title ?? ''} {...props}/>
|
||||
)
|
||||
}
|
||||
|
|
|
@ -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}
|
||||
/>
|
||||
|
|
Loading…
Reference in a new issue