Skip to content

Commit a0d0670

Browse files
anderskdelucis
andauthored
Move <summary> to top of <details> for validity (#3423)
Co-authored-by: Chris Swithinbank <[email protected]>
1 parent d9bae74 commit a0d0670

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/small-singers-smell.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@astrojs/starlight': patch
3+
---
4+
5+
Fixes HTML validity in sidebar groups by ensuring `<summary>` is the first child of `<details>`

packages/starlight/components/SidebarSublist.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ const { sublist, nested } = Astro.props;
3737
<details
3838
open={flattenSidebar(entry.entries).some((i) => i.isCurrent) || !entry.collapsed}
3939
>
40-
<SidebarRestorePoint />
4140
<summary>
4241
<span class="group-label">
4342
<span class="large">{entry.label}</span>
@@ -51,6 +50,7 @@ const { sublist, nested } = Astro.props;
5150
</span>
5251
<Icon name="right-caret" class="caret" size="1.25rem" />
5352
</summary>
53+
<SidebarRestorePoint />
5454
<Astro.self sublist={entry.entries} nested />
5555
</details>
5656
)}

0 commit comments

Comments
 (0)