File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010 */
1111
1212import cx from 'classnames' ;
13+ import Link from 'next/link' ;
1314import { useTocHighlight } from './useTocHighlight' ;
1415import { IsInTocContext } from '../MDX/TocContext' ;
1516import type { Toc } from '../MDX/TocContext' ;
@@ -52,7 +53,7 @@ export function Toc({headings}: {headings: Toc}) {
5253 hidden : h . depth && h . depth > 3 ,
5354 }
5455 ) } >
55- < a
56+ < Link
5657 className = { cx (
5758 selectedIndex === i
5859 ? 'text-link dark:text-link-dark font-bold'
@@ -61,7 +62,7 @@ export function Toc({headings}: {headings: Toc}) {
6162 ) }
6263 href = { h . url } >
6364 { h . text }
64- </ a >
65+ </ Link >
6566 </ li >
6667 ) ;
6768 } ) }
Original file line number Diff line number Diff line change 1010 */
1111
1212import cn from 'classnames' ;
13+ import Link from 'next/link' ;
1314import * as React from 'react' ;
1415import { forwardRefWithAs } from 'utils/forwardRefWithAs' ;
1516export interface HeadingProps {
@@ -33,7 +34,7 @@ const Heading = forwardRefWithAs<HeadingProps, 'div'>(function Heading(
3334 < Comp id = { id } { ...props } ref = { ref } className = { cn ( 'mdx-heading' , className ) } >
3435 { children }
3536 { isPageAnchor && (
36- < a
37+ < Link
3738 href = { `#${ id } ` }
3839 aria-label = { label }
3940 title = { label }
@@ -52,7 +53,7 @@ const Heading = forwardRefWithAs<HeadingProps, 'div'>(function Heading(
5253 < path d = "M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z" />
5354 </ g >
5455 </ svg >
55- </ a >
56+ </ Link >
5657 ) }
5758 </ Comp >
5859 ) ;
You can’t perform that action at this time.
0 commit comments