Skip to content

Commit

Permalink
Remove base path from <Link /> (#416)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucas-janon authored Jul 31, 2024
1 parent eda62df commit 7a92d56
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/components/Cmdk/components/MarkdownMesage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ export const MarkdownMessage: React.FC<MarkdownMessageProps> = ({ closeCmdk, mes
),
a: ({ children, ref, ...args }) => {
if (typeof args.href !== "string") return null;
const isAbsoluteHref = args.href?.startsWith("http");

return (
<Link
{...args}
href={isAbsoluteHref ? args.href : `${basePath}${args.href}`}
href={args.href}
onClick={closeCmdk}
className={clsx("text-green-300 hover:text-green-400", args.className)}
>
Expand Down

0 comments on commit 7a92d56

Please sign in to comment.