Skip to content

Commit

Permalink
dont render image in markdown (#1724)
Browse files Browse the repository at this point in the history
related #1721
  • Loading branch information
notmd committed Feb 20, 2023
1 parent ad8a6b5 commit 1d3eea8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion website/src/components/Messages/RenderedMarkdown.tsx
Expand Up @@ -74,6 +74,8 @@ const sx: SystemStyleObject = {

const plugins = [remarkGfm];

const disallowedElements = ["img"];

// eslint-disable-next-line react/display-name
const RenderedMarkdown = ({ markdown }: RenderedMarkdownProps) => {
const { isOpen, onOpen, onClose } = useDisclosure();
Expand Down Expand Up @@ -160,7 +162,7 @@ const RenderedMarkdown = ({ markdown }: RenderedMarkdownProps) => {
const MemorizedMarkdown = memo((props: ReactMarkdownOptions) => {
return (
<Prose as="div" sx={sx}>
<ReactMarkdown remarkPlugins={plugins} {...props}></ReactMarkdown>
<ReactMarkdown {...props} disallowedElements={disallowedElements} remarkPlugins={plugins}></ReactMarkdown>
</Prose>
);
});
Expand Down

0 comments on commit 1d3eea8

Please sign in to comment.