瀏覽代碼

fix lint error

ryoji-s 3 年之前
父節點
當前提交
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}>