feat!: stabilize experimental.headingIdCompat#14494
Conversation
🦋 Changeset detectedLatest commit: abfd07f The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
delucis
left a comment
There was a problem hiding this comment.
Looks good! Thanks for tackling @florian-lefebvre 💖
Left a couple of queries and requesting changes so we don’t forget to resolve the changeset TODO.
| let slug = headingSlugger.slug(textContent); | ||
|
|
||
| if (!experimentalHeadingIdCompat) { | ||
| if (slug.endsWith('-')) slug = slug.slice(0, -1); | ||
| } | ||
| return slug; | ||
| return headingSlugger.slug(textContent); |
There was a problem hiding this comment.
Noting that I’m not familiar enough with the Markdoc integration to know if there’s a good way for users to modify our logic if they want backwards compatibility.
We have docs on using a custom heading component, but not on how to generate your own id.
Maybe they have to write their own transform() for headings? We’d need to test.
If it’s super onerous, does anyone think we should offer a backwards compat option for the Markdoc integration? Or do we just embrace that it’s a breaking change and people need to update their links. Markdoc usage is fairly low and the cases where this is breaking will be relatively infrequent.
There was a problem hiding this comment.
Yeah given how low it is, I don't think it's worth investing a lof of effort in it
delucis
left a comment
There was a problem hiding this comment.
Looks good once we update the changeset!
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
delucis
left a comment
There was a problem hiding this comment.
Spotted one detail but them LGTM!
Co-authored-by: Chris Swithinbank <swithinbank@gmail.com>
Co-authored-by: Sarah Rainsberger <5098874+sarah11918@users.noreply.github.com>
Changes
experimental.headingIdCompat#14378Testing
Updated
Docs
withastro/docs#12510