chore(use-cases): drop Detail wrapper + add markdown renderer tests#18
Merged
Conversation
Two related cleanups: 1. UseCaseDetailPage no longer wraps the body in a redundant "Detail" <h2> section. With every case now carrying its own ## Sample agent prompt / ## Steps to follow / ## Why this works / ## Related cases headings, the wrapper was forcing those to render as h3 — a misleading nesting level that pushed real semantic structure too deep. Body now renders at baseHeading=h2 so its sections are peers of the page's own h1 hero. The auto-generated "How to set it up" and "Why this is useful" sections move into an AutoDetail fallback component used only when a case has no body yet (currently no cases, kept for future resilience). 2. New unit tests at src/lib/markdown.test.tsx covering the shared markdown renderer — every block construct (## / ### / fenced code / -/* bullets / 1./2. ordered lists / > blockquote / | tables / paragraphs), every inline construct (**bold**, \`code\`, [text](url)), the href-safety check (rejects javascript:, data:, vbscript:; allows /, #, http(s)://), and configurable baseHeading. 26 tests, all pass in ~4ms. Closes the test-coverage gap the dashboard sweep agent flagged. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Drops the redundant Detail h2 wrapper on use-case detail pages so body sections render as proper h2 peers, and adds 26 unit tests for the shared markdown renderer covering blocks/inline/href-safety. All 26 tests pass.