@@ -30,7 +30,10 @@ const CustomHeading = ({
3030 // Convert children to array and strip any inner anchor (native 'a' or MarkdownLink)
3131 const childrenArray = React . Children . toArray ( children )
3232 const sanitizedChildren = childrenArray . map ( ( child ) => {
33- if ( React . isValidElement ( child ) && ( child . type === 'a' || child . type === MarkdownLink ) ) {
33+ if (
34+ React . isValidElement ( child ) &&
35+ ( child . type === 'a' || child . type === MarkdownLink )
36+ ) {
3437 // replace anchor child with its own children so outer anchor remains the only link
3538 return child . props . children ?? null
3639 }
@@ -45,7 +48,10 @@ const CustomHeading = ({
4548
4649 if ( id ) {
4750 return (
48- < a href = { `#${ id } ` } className = { `anchor-heading *:scroll-my-20 *:lg:scroll-my-4` } >
51+ < a
52+ href = { `#${ id } ` }
53+ className = { `anchor-heading *:scroll-my-20 *:lg:scroll-my-4` }
54+ >
4955 { heading }
5056 </ a >
5157 )
@@ -55,8 +61,7 @@ const CustomHeading = ({
5561}
5662
5763const makeHeading =
58- ( type : HeadingLevel ) =>
59- ( props : HTMLProps < HTMLHeadingElement > ) =>
64+ ( type : HeadingLevel ) => ( props : HTMLProps < HTMLHeadingElement > ) =>
6065 (
6166 < CustomHeading
6267 Comp = { type }
@@ -327,7 +332,9 @@ const options: HTMLReactParserOptions = {
327332 domToReact ( panel . children as any , options )
328333 )
329334
330- return < Tabs tabs = { tabs } children = { children as any } />
335+ return (
336+ < Tabs id = { attributes . id } tabs = { tabs } children = { children as any } />
337+ )
331338 }
332339 default :
333340 return < div > { domToReact ( domNode . children as any , options ) } </ div >
0 commit comments