Merge pull request #31329 from ethereum/header-parsing-fix

This commit is contained in:
Corwin Smith 2025-03-07 04:35:59 -07:00 committed by GitHub
commit 0852f60e98
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 10 deletions

View file

@ -14,8 +14,9 @@ export const DocumentNav: FC<Props> = ({ content }) => {
.split('\n\n')
.map(item => item.replace(/[\n\r]/g, ''))
.filter(item => item.startsWith('##'))
.filter(item => !item.startsWith('####'))
.map(item => parseHeadingId([item]))
.filter(item => item);
.filter(item => item)
const activeHash = useActiveHash(parsedHeadings.map(heading => heading!.headingId));

View file

@ -91,15 +91,6 @@ const MDComponents = {
</Heading>
);
},
h4: ({ children }: any) => {
const { children: parsedChildren, headingId } = parseHeadingId(children);
return (
<Heading as='h4' mb='2.5 !important' {...h4} id={headingId}>
{parsedChildren}
</Heading>
);
},
// tables
table: ({ children }: any) => (
<Flex overflowX='auto'>