|
|
@@ -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}>
|