From 7faa2df7cada13769dd2c031bae1d224c9523ca0 Mon Sep 17 00:00:00 2001 From: Terry Sutton Date: Mon, 13 Feb 2023 12:50:31 -0330 Subject: [PATCH] Fix custom anchors --- apps/docs/components/CustomHTMLElements/Heading.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/docs/components/CustomHTMLElements/Heading.tsx b/apps/docs/components/CustomHTMLElements/Heading.tsx index 74f3511b110..9d427e79b99 100644 --- a/apps/docs/components/CustomHTMLElements/Heading.tsx +++ b/apps/docs/components/CustomHTMLElements/Heading.tsx @@ -25,9 +25,10 @@ interface Props { * expected tocList format (text, link,level). * * In tsx files, we can generate this tocList directly. For these files, we don't - * need to parse the and generate anchors + * need to parse the and generate anchors. Custom anchors are used in tsx files. + * (see: /pages/reference/cli/config.tsx) */ -const Heading: React.FC = ({ tag, parseAnchors = false, customAnchor, children }) => { +const Heading: React.FC = ({ tag, customAnchor, children }) => { const HeadingTag = `${tag}` as any const anchor = customAnchor ? customAnchor : getAnchor(children) const link = `#${anchor}` @@ -43,7 +44,7 @@ const Heading: React.FC = ({ tag, parseAnchors = false, customAnchor, chi return ( - {parseAnchors ? removeAnchor(children) : children} + {removeAnchor(children)} {anchor && ( #