ryoji-s 3 лет назад
Родитель
Сommit
0c72495ee3
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      packages/app/src/components/ReactMarkdownComponents/NextLink.tsx

+ 2 - 2
packages/app/src/components/ReactMarkdownComponents/NextLink.tsx

@@ -23,7 +23,7 @@ const isExternalLink = (href: string, siteUrl: string | undefined): boolean => {
 };
 
 const isAttached = (href: string): boolean => {
-  return href.toString().startsWith('/attachment/');
+  return href.startsWith('/attachment/');
 };
 
 type Props = Omit<LinkProps, 'href'> & {
@@ -65,7 +65,7 @@ export const NextLink = (props: Props): JSX.Element => {
 
   // when href is an attachment file
   if (isAttached(href)) {
-    const dlhref = href.toString().replace('/attachment/', '/download/');
+    const dlhref = href.replace('/attachment/', '/download/');
     return (
       <span>
         <a href={href} className={className} target="_blank" rel="noopener noreferrer" {...dataAttributes}>