souporserious / mdxts

The Content and Documentation SDK for React

Home Page:https://mdxts.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong heading id in production

leannepepper opened this issue · comments

I'm not sure what's wrong here but locally headings have the correct id but in production they have a "-2" appended to them:
Screenshot 2024-03-05 at 3 20 06 PM

Hm I suspect this is happening in the remark plugin here that calculates the heading slugs. It is being reset each time when the plugin runs which is weird why it's adding the suffix 🤔. Does this happen to every heading or only some of them?

I noticed I had the same title being used in multiple places, making sure they were all unique fixed the issue 😄

Ok cool! This should be documented better how this works. In this case, using the headings metadata exported from the module should offer the correct ids used in the content even if there are duplicate titles.