fix: JSDoc code block syntax in TableOfContents component#431
fix: JSDoc code block syntax in TableOfContents component#431ainsleyclark merged 3 commits intomainfrom
Conversation
The @example code snippets inside the HTML comment block contained <!-- --> style comments which prematurely closed the outer HTML comment. This caused Svelte to parse <RichText> as actual markup, resulting in 'ReferenceError: RichText is not defined' at runtime. Replaced inner <!-- --> comments with {/* */} to avoid breaking the outer HTML comment boundary. https://claude.ai/code/session_0172a2vJSGboESNTT38sDb9U
Simplify the fix - just remove the inline <!-- --> comments from the @example snippets rather than replacing them with {/* */} syntax. https://claude.ai/code/session_0172a2vJSGboESNTT38sDb9U
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Review summary
Correct, targeted fix for a genuine runtime bug. The nested HTML comments inside the outer Critical issuesNone WarningsLoss of example context — The removed comments ( SuggestionsConsider {/* Attach data attributes to the content element */}
<RichText content={data.body} data-sidebar-content="true" data-sidebar-selector="h3" />
{/* TOC auto-discovers headings */}
<TableOfContents heading="On this page" /> |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #431 +/- ##
==========================================
+ Coverage 64.59% 70.26% +5.67%
==========================================
Files 154 187 +33
Lines 6064 7439 +1375
==========================================
+ Hits 3917 5227 +1310
+ Misses 2064 2012 -52
- Partials 83 200 +117 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Summary
Updated JSDoc example code blocks in the TableOfContents component to use correct JavaScript/JSX comment syntax instead of HTML comment syntax.
Changes
<!-- -->) to JavaScript block comments ({/* */}) in all four JSDoc@exampleblocksDetails
The documentation examples were using HTML comment syntax within Svelte code blocks, which is incorrect. JavaScript block comments are the appropriate syntax for these examples and will render correctly in documentation generators and IDEs that parse JSDoc comments.
https://claude.ai/code/session_0172a2vJSGboESNTT38sDb9U