Update addons/docs/src/blocks/mdx.tsx

This commit is contained in:
Michael Shilman 2021-03-26 13:04:33 +08:00 committed by GitHub
parent d74daf18e5
commit a24c2e3b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,6 +95,8 @@ export const AnchorMdx: FC<AnchorMdxProps> = (props) => {
href={href}
onClick={(event: SyntheticEvent) => {
event.preventDefault();
// use the A element's href, which has been modified for
// local paths without a `?path=` query param prefix
navigate(event.currentTarget.getAttribute('href'));
}}
target={target}