Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-toc-nested-comments.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ainsleydev/sveltekit-helper": patch
---

Fix `TableOfContents` component erroring at runtime due to nested HTML comments in the `@component` doc block closing the outer comment early, causing Svelte to parse example markup as real template code.
Original file line number Diff line number Diff line change
Expand Up @@ -114,16 +114,12 @@ export type TableOfContentsProps = {

@example
```svelte
<!-- 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" />
```

@example
```svelte
<!-- Explicit prop overrides -->
<TableOfContents
contentSelector=".article-body"
headingSelector="h2, h3"
Expand All @@ -134,7 +130,6 @@ export type TableOfContentsProps = {

@example
```svelte
<!-- Manual items (scrollspy still driven by DOM) -->
<TableOfContents items={[{ label: 'Intro', href: 'intro' }]} />
```
-->
Expand Down
Loading