Skip to content

Commit

Permalink
Changed table of content anchor tags to be a HR
Browse files Browse the repository at this point in the history
  • Loading branch information
spindle79 committed Oct 27, 2023
1 parent 6cfc5eb commit ed72002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/components/src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ const renderTypography =
const hasEmbed = node?.content?.some((child: any) => child.nodeType?.includes('embedded'));
return (
<>
{variant?.startsWith('h') && node?.data?.id ? <a id={node?.data?.id} className="jumplink" /> : null}
{variant?.startsWith('h') && node?.data?.id ? <hr id={node?.data?.id} className="jumplink" /> : null}
{/* Use div as Typograph to use the correct styles and avoid invalid DOM nesting when there embedded entries */}
<Typography variant={variant} {...(hasEmbed && { component: 'span' })} data-testid={`Text-${variant}`}>
{children.map((child: any) => {
Expand All @@ -80,7 +80,7 @@ const renderTypography =

return (
<>
{variant?.startsWith('h') && node?.data?.id ? <a id={node?.data?.id} className="jumplink" /> : null}
{variant?.startsWith('h') && node?.data?.id ? <hr id={node?.data?.id} className="jumplink" /> : null}
<Typography variant={variant} data-testid={`Text-${variant}`}>
{children}
</Typography>
Expand Down Expand Up @@ -239,7 +239,7 @@ const Root = styled(Box, {
overridesResolver: (_, styles) => [styles.root]
})<{ variant?: string }>(({ theme }) => {
return {
'& a.jumplink': {
'& hr.jumplink': {
display: 'block',
position: 'relative',
visibility: 'hidden',
Expand Down

0 comments on commit ed72002

Please sign in to comment.