@@ -1,4 +1,5 @@
11import React from "react";
2+import Link from "next/link";
23import Markdoc, { Ast, Node, Tag, Raw } from "@markdoc/markdoc";
34import { heading } from "./schema/Heading.markdoc";
45import { footnoteRef } from "./schema/footnoteRef.markdoc";
@@ -126,6 +127,14 @@ const superscript = ({ children }) => <sup>{children}</sup>;
126127
127128const CustomFence = ({ children }) => <pre>{children}</pre>;
128129
130+const NextLink = ({ href, target, children }) => {
131+ return (
132+ <Link href={href} passHref>
133+ <a target={target}>{children}</a>
134+ </Link>
135+ );
136+};
137+
129138export function MarkdownParse({ post }) {
130139 const tokeniser = new Markdoc.Tokenizer({ html: true, linkify: true });
131140 const tokens = tokeniser.tokenize(post.content);
@@ -150,6 +159,7 @@ export function MarkdownParse({ post }) {
150159 customFence,
151160 RenderHtml,
152161 superscript,
162+ NextLink,
153163 },
154164 });
155165}
@@ -164,6 +174,7 @@ export default function Markdown({ content }) {
164174 Callout,
165175 CustomFence,
166176 RenderHtml,
177+ NextLink,
167178 },
168179 });
169180}