Skip to content

Commit 2b8d965

Browse files
committed
fix: add alt attribute to img component for improved accessibility
1 parent 1c4ec68 commit 2b8d965

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/Markdown.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,10 +91,11 @@ const markdownComponents: Record<string, React.FC> = {
9191
iframe: (props) => (
9292
<iframe {...props} className="w-full" title="Embedded Content" />
9393
),
94-
img: ({ ...props }: HTMLProps<HTMLImageElement>) => (
95-
// eslint-disable-next-line jsx-a11y/alt-text
94+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
95+
img: ({ children, alt, ...props }: HTMLProps<HTMLImageElement>) => (
9696
<img
9797
{...props}
98+
alt={alt ?? ''}
9899
className={`max-w-full h-auto rounded-lg shadow-md ${
99100
props.className ?? ''
100101
}`}

0 commit comments

Comments
 (0)