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
{{ message }}
Repository navigation
fix: preserve blog section headings and code comments - #1375
The title cleanup in #1370 removes the first line beginning with # anywhere in an article. This deletes Form v1's installation heading and comments inside five other articles' code examples.
Parse the original Markdown, then remove only a leading H1 from the document and table of contents. Skip editorial HTML comments, preserve visible HTML, and retain later heading anchors.
Validation: four focused regression tests cover fenced code, later headings, editorial comments, visible HTML and duplicate heading anchors. All six affected article ASTs are preserved. Earlier local browser checks confirmed Form's heading and TOC link and Query's code comment. Both equivalent production builds passed; the article chunk grows 220 raw bytes / 114 gzip bytes. An 81-article microbenchmark showed no obvious slowdown, not a runtime guarantee. This small measured cost fixes lost article content without adding a dependency.
Full pnpm test passed before rebasing the fix onto current main. CI will validate the rebased head.
Summary by CodeRabbit
Bug Fixes
Improved blog post title handling when content begins with HTML comments, preserving subsequent headings and their links.
Visible HTML before a heading is now handled correctly when determining whether to omit a leading title.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: 98a56d7a-45da-4c51-9217-9d62549ba9bb
📥 Commits
Reviewing files that changed from the base of the PR and between 7c96ea3 and 11466ec.
📒 Files selected for processing (3)
src/routes/blog.$.tsx
src/utils/blogMarkdown.ts
tests/blog-markdown.test.ts
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
📝 Walkthrough
The blog route now parses full post content with parseBlogMarkdown. The parser removes a leading H1 and its matching heading metadata after skipping HTML blocks that contain only whitespace-separated comments.
Changes: Blog Markdown parsing
Layer / File(s)
Summary
Parser behavior and route integration src/utils/blogMarkdown.ts, src/routes/blog.$.tsx, tests/blog-markdown.test.ts
Adds parseBlogMarkdown and uses it to parse full blog content. Tests cover leading-title removal, comment and visible HTML handling, and heading anchors.
The change has no identified merge-blocking risk; it is ready for normal checks.
Pre-merge checks · 4 · 1
Failed checks (1 warning)
Check name
Status
Explanation
Resolution
Docstring Coverage
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 3 files.
Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed checks (4 passed)
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title clearly and concisely describes the main change: preserving blog section headings and code comments during Markdown parsing.
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The title cleanup in #1370 removes the first line beginning with
#anywhere in an article. This deletes Form v1's installation heading and comments inside five other articles' code examples.Parse the original Markdown, then remove only a leading H1 from the document and table of contents. Skip editorial HTML comments, preserve visible HTML, and retain later heading anchors.
Validation: four focused regression tests cover fenced code, later headings, editorial comments, visible HTML and duplicate heading anchors. All six affected article ASTs are preserved. Earlier local browser checks confirmed Form's heading and TOC link and Query's code comment. Both equivalent production builds passed; the article chunk grows 220 raw bytes / 114 gzip bytes. An 81-article microbenchmark showed no obvious slowdown, not a runtime guarantee. This small measured cost fixes lost article content without adding a dependency.
Full
pnpm testpassed before rebasing the fix onto current main. CI will validate the rebased head.Summary by CodeRabbit