Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 6 additions & 11 deletions src/theme/MDXComponents/A/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import Link from '@docusaurus/Link';
import { useAnchorTargetClassName } from '@docusaurus/theme-common';
import type { Props } from '@theme/MDXComponents/A';
import clsx from 'clsx';
import React, { type ReactNode } from 'react';
import A from '@theme-original/MDXComponents/A';
import type AType from '@theme/MDXComponents/A';
import React, { type ComponentProps, type ReactNode } from 'react';

export default function MDXA(props: Props): ReactNode {
// MDX Footnotes have ids such as <a id="user-content-fn-1-953011" ...>
const anchorTargetClassName = useAnchorTargetClassName(props.id);
type Props = ComponentProps<typeof AType>;

export default function AWrapper(props: Props): ReactNode {
// Customize rel attribute for *.defined.net links
let customRel = props.rel;
let customTarget = props.target;
Expand All @@ -25,7 +22,5 @@ export default function MDXA(props: Props): ReactNode {
}
}

return (
<Link {...props} rel={customRel} target={customTarget} className={clsx(anchorTargetClassName, props.className)} />
);
return <A rel={customRel} target={customTarget} {...props} />;
}