diff --git a/homepage/src/components/MarkdownNavbar/index.tsx b/homepage/src/components/MarkdownNavbar/index.tsx index e9a38c7..d74381b 100644 --- a/homepage/src/components/MarkdownNavbar/index.tsx +++ b/homepage/src/components/MarkdownNavbar/index.tsx @@ -86,10 +86,10 @@ const MarkdownNavbar: FC = (props) => { const getNavStructure: (source: string) => Nav[] = (source) => { const contentWithoutCode = source + .replace(/```[^`\n]*\n+[^```]+```\n+/g, "") .replace(/^[^#]+\n/g, "") .replace(/(?:[^\n#]+)#+\s([^#\n]+)\n*/g, "") // 匹配行内出现 # 号的情况 .replace(/^#\s[^#\n]*\n+/, "") - .replace(/```[^`\n]*\n+[^```]+```\n+/g, "") .replace(/`([^`\n]+)`/g, "$1") .replace(/\*\*?([^*\n]+)\*\*?/g, "$1") .replace(/__?([^_\n]+)__?/g, "$1")