shadcn-ui / taxonomy

An open source application built using the new router, server components and everything new in Next.js 13.
https://tx.shadcn.com
MIT License
18.34k stars 2.55k forks source link

rehypeAutolinkHeadings doesn't wrap the heading text #94

Open FranciscoMoretti opened 1 year ago

FranciscoMoretti commented 1 year ago

subheadings titles don't have a link because the anchor tag doesn't wrap the text of the titles.

When there is no heading component in mdx.tsx (e.g. h2), rehypeAutolinkHeadings works as expected. It seems that the transformation that's performed in mdx.tsx is not compatible with the contentlayer rehype plugin.

More info https://github.com/rehypejs/rehype-autolink-headings/issues/15

FranciscoMoretti commented 1 year ago

It turns out that the fix was quite simple actually https://github.com/shadcn/taxonomy/pull/96