Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
olexh committed Mar 25, 2024
1 parent 3c078f6 commit 94977bd
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions components/markdown/viewer/_components/link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,16 @@ const ALLOWED_HOSTS = [
const Component = ({ children, href, className }: PropsWithChildren<Props>) => {
if (href.includes('hikka.io') || !href.includes('http')) {
if (href.includes('/anime')) {
return (
<AnimeTooltip slug={href.split('/anime/')[1].split('/')[0]}>
<Link href={href}>{children}</Link>
</AnimeTooltip>
);
const link = href.split('/anime/')[1]?.split('/')[0]

if (link) {
return (
<AnimeTooltip slug={link}>
<Link href={href}>{children}</Link>
</AnimeTooltip>
);
}

}

return <Link href={href}>{children}</Link>;
Expand Down

0 comments on commit 94977bd

Please sign in to comment.