diff --git a/src/components/markdown/markdown.tsx b/src/components/markdown/markdown.tsx index 84a3ecf5..d0f5e933 100644 --- a/src/components/markdown/markdown.tsx +++ b/src/components/markdown/markdown.tsx @@ -6,9 +6,11 @@ import supersub from 'remark-supersub'; import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'; import { useDismiss, useFloating, useFocus, useHover, useInteractions, offset, shift, size, autoUpdate, Placement, FloatingPortal } from '@floating-ui/react'; import { getLinkMediaInfo, getHasThumbnail } from '../../lib/utils/media-utils'; +import { isCatalogView } from '../../lib/utils/view-utils'; import useIsMobile from '../../hooks/use-is-mobile'; import CommentMedia from '../comment-media'; import styles from './markdown.module.css'; +import { useLocation, useParams } from 'react-router-dom'; interface ContentLinkEmbedProps { children: any; @@ -146,6 +148,8 @@ const Markdown = ({ content, spoiler }: MarkdownProps) => { remarkPlugins.push([blockquoteToGreentext]); + const isInCatalogView = isCatalogView(useLocation().pathname, useParams()); + return ( { video: ({ src }) => {src}, iframe: ({ src }) => {src}, source: ({ src }) => {src}, - hr: () => ( -
-
-
- ), + hr: () => + !isInCatalogView && ( +
+
+
+ ), a: ({ href, children }) => { - if (href) { + if (href && !isInCatalogView) { const linkMediaInfo = getLinkMediaInfo(href); if (getHasThumbnail(linkMediaInfo, href)) { return ;