fix extern links md

This commit is contained in:
Evan Simkowitz 2024-09-06 17:30:19 -07:00
parent cab701d3ea
commit 1591a0ca26
No known key found for this signature in database

View File

@ -14,12 +14,16 @@ import rehypeRaw from "rehype-raw";
import rehypeSlug from "rehype-slug";
import RemarkFlexibleToc, { TocItem } from "remark-flexible-toc";
import remarkGfm from "remark-gfm";
import { openLink } from "../store/global";
import "./markdown.less";
const Link = ({ href, children }: { href: string; children: React.ReactNode }) => {
const newUrl = "https://extern?" + encodeURIComponent(href);
const onClick = (e: React.MouseEvent) => {
e.preventDefault();
openLink(href);
};
return (
<a href={newUrl} target="_blank" rel="noopener">
<a href={href} onClick={onClick}>
{children}
</a>
);