diff --git a/src/components/ui/markdown/Markdown.tsx b/src/components/ui/markdown/Markdown.tsx index f593bbbef9..a6191f5611 100644 --- a/src/components/ui/markdown/Markdown.tsx +++ b/src/components/ui/markdown/Markdown.tsx @@ -38,7 +38,7 @@ import { MFootNote } from './renderers/footnotes' import { MHeader } from './renderers/heading' import { MarkdownImage } from './renderers/image' import { MTag } from './renderers/tag' -import { getFootNoteDomId } from './utils/get-id' +import { getFootNoteDomId, getFootNoteRefDomId } from './utils/get-id' import { redHighlight } from './utils/redHighlight' const CodeBlock = dynamic(() => import('~/components/widgets/shared/CodeBlock')) @@ -157,7 +157,7 @@ export const Markdown: FC = footnoteReference: { react(node, output, state) { - const { footnoteMap, target, content } = node + const { footnoteMap, content } = node const footnote = footnoteMap.get(content) const linkCardId = (() => { try { @@ -181,7 +181,7 @@ export const Markdown: FC = as="span" TriggerComponent={() => ( { e.preventDefault() const id = getFootNoteDomId(content) @@ -192,7 +192,9 @@ export const Markdown: FC = redHighlight(id) }} > - {`[^${content}]`} + {`[^${content}]`} )} type="tooltip" diff --git a/src/components/ui/markdown/renderers/footnotes.tsx b/src/components/ui/markdown/renderers/footnotes.tsx index 28f31bf147..2ae690e635 100644 --- a/src/components/ui/markdown/renderers/footnotes.tsx +++ b/src/components/ui/markdown/renderers/footnotes.tsx @@ -11,25 +11,24 @@ export const MFootNote: FC = (props) => { return (
- {React.Children.map(props.children, (child, index) => { + {React.Children.map(props.children, (child) => { if (React.isValidElement(child)) { + const id = child.props.id return ( -