Skip to content

Commit

Permalink
🐞fix: fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
blinko-space committed Nov 10, 2024
1 parent 815a46a commit 16b434e
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/components/Common/MarkdownRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,15 @@ const Code = ({ className, children, ...props }) => {

const LinkPreview = ({ href }) => {
console.log(String(href))
if (href?.startsWith('<img')) {
return <PhotoProvider>
<PhotoView src={href.match(/src="([^"]+)"/)?.[1]}>
<div className='rounded-lg cursor-pointer' dangerouslySetInnerHTML={{ __html: href }} />
</PhotoView>
</PhotoProvider>


try {
if (href?.startsWith('<img')) {
return <PhotoProvider>
<PhotoView src={href.match(/src="([^"]+)"/)?.[1]}>
<div className='rounded-lg cursor-pointer' dangerouslySetInnerHTML={{ __html: href }} />
</PhotoView>
</PhotoProvider>
}
} catch (error) {
}
// const [previewData, setPreviewData] = useState<LinkInfo | null>(null);
const store = RootStore.Local(() => ({
Expand Down

0 comments on commit 16b434e

Please sign in to comment.