mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-15 04:26:37 +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')
|
.split('\n\n')
|
||||||
.map(item => item.replace(/[\n\r]/g, ''))
|
.map(item => item.replace(/[\n\r]/g, ''))
|
||||||
.filter(item => item.startsWith('##'))
|
.filter(item => item.startsWith('##'))
|
||||||
|
.filter(item => !item.startsWith('####'))
|
||||||
.map(item => parseHeadingId([item]))
|
.map(item => parseHeadingId([item]))
|
||||||
.filter(item => item);
|
.filter(item => item)
|
||||||
|
|
||||||
const activeHash = useActiveHash(parsedHeadings.map(heading => heading!.headingId));
|
const activeHash = useActiveHash(parsedHeadings.map(heading => heading!.headingId));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,15 +91,6 @@ const MDComponents = {
|
||||||
</Heading>
|
</Heading>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
h4: ({ children }: any) => {
|
|
||||||
const { children: parsedChildren, headingId } = parseHeadingId(children);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<Heading as='h4' mb='2.5 !important' {...h4} id={headingId}>
|
|
||||||
{parsedChildren}
|
|
||||||
</Heading>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
// tables
|
// tables
|
||||||
table: ({ children }: any) => (
|
table: ({ children }: any) => (
|
||||||
<Flex overflowX='auto'>
|
<Flex overflowX='auto'>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue