fix: avoid TOC anchors being hidden by header#469
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c2e5cacd45
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| {...props} | ||
| className="text-2xl font-bold mt-4" | ||
| style={{ ...props.style, scrollMarginTop: "var(--header-scroll-offset, 7rem)" }} |
There was a problem hiding this comment.
Preserve markdown-provided heading classes
Rendering each heading with {...props} followed by a fixed className drops any class attributes coming from markdown (via rehypeRaw) or remark/rehype plugins, because the hardcoded class now overwrites props.className. This is a behavior change introduced in this commit that can break documents relying on custom heading classes for styling or JS hooks; merge props.className with the default classes instead of replacing it.
Useful? React with 👍 / 👎.
|
🧹 Preview deployment has been cleaned up. The temporary preview environment for this PR has been deleted. |
Summary
Closes #220