mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +00:00
Merge pull request #31329 from ethereum/header-parsing-fix
This commit is contained in:
commit
0852f60e98
2 changed files with 2 additions and 10 deletions
|
|
@ -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));
|
||||
|
||||
|
|
|
|||
|
|
@ -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'>
|
||||
|
|
|
|||
Loading…
Reference in a new issue