Skip to content

Commit

Permalink
feat: add support for rendering md-embedded images correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
procaconsul committed Jun 6, 2024
1 parent 2c65448 commit 48ef8e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ const Markdown: FC<MarkdownProps> = ({ children }) => {
const { children, ...rest } = props
return <Link {...rest}>{children}</Link>
},
img(props) {
return <img alt="" style={{ width: '100%', height: 'auto' }} {...props} />
},
}
return (
<MarkdownRoot components={componentMapping} remarkPlugins={[remarkGfm]}>
<MarkdownRoot
components={componentMapping}
urlTransform={(value: string) => value}
remarkPlugins={[remarkGfm]}
>
{children}
</MarkdownRoot>
)
Expand Down

0 comments on commit 48ef8e7

Please sign in to comment.