Skip to content

Commit

Permalink
[techdocs] Fix Heading (#635)
Browse files Browse the repository at this point in the history
Fix the `renderHeading` function, which was still using the `level`
property which isn't available anymore. We are now using the
`node.tagName` property to render the element.
  • Loading branch information
ricoberger authored Apr 15, 2024
1 parent e682198 commit 26db575
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/packages/techdocs/src/utils/renderers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const renderHeading = ({ ...props }: any): ReactElement => {
const children = Children.toArray(props.children);
const text = children.reduce(flatten, '');
const slug = text.toLowerCase().replace(/\W/g, '-');
return createElement('h' + props.level, { id: slug }, props.children);
return createElement(props.node.tagName, { id: slug }, props.children);
};

/**
Expand Down

0 comments on commit 26db575

Please sign in to comment.