diff --git a/src/components/note/content/index.tsx b/src/components/note/content/index.tsx index d3099a66..742a3227 100644 --- a/src/components/note/content/index.tsx +++ b/src/components/note/content/index.tsx @@ -3,7 +3,7 @@ import NotePreview from '@components/note/content/preview'; import { UserExtend } from '@components/user/extend'; import dynamic from 'next/dynamic'; -import { memo } from 'react'; +import { memo, useMemo } from 'react'; const MarkdownPreview = dynamic(() => import('@uiw/react-markdown-preview'), { ssr: false, @@ -11,17 +11,24 @@ const MarkdownPreview = dynamic(() => import('@uiw/react-markdown-preview'), { }); export const Content = memo(function Content({ data }: { data: any }) { + const content = useMemo( + () => + // remove all image urls + data.content.replace(/(https?:\/\/.*\.(jpg|jpeg|gif|png|webp)((\?.*)$|$))/i, ''), + [data.content] + ); + return (
+ This feature hasn't implemented yet, so resize Lume to the initial size for a better experience. + I'm sorry for this inconvenience, and I swear I will add it soon 😁 +
+