You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: respect global tableOfContents config with zod v4
With zod v4, `.default(value).optional()` returns the default value
for `undefined` input instead of `undefined` itself. This caused
frontmatter `tableOfContents` to always resolve to the schema default,
preventing the global Starlight config from being used as a fallback.
This fix introduces a separate `FrontmatterTableOfContentsSchema` that
omits `.default()` so `undefined` is preserved, and updates `getToC()`
to properly merge frontmatter values with the global config.
Closes#3748
Fixes global `tableOfContents` config being ignored due to a zod v4 behavior change where `.default().optional()` returns the default value for `undefined` input instead of `undefined` itself.
0 commit comments