@astrojs/starlight 0.37.6 → 0.37.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +1 -1
- package/user-components/rehype-steps.ts +10 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @astrojs/starlight
|
|
2
2
|
|
|
3
|
+
## 0.37.7
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#3726](https://github.com/withastro/starlight/pull/3726) [`8a09b60`](https://github.com/withastro/starlight/commit/8a09b60b03ae2b99d3418f41e984ffa46468e3a2) Thanks [@delucis](https://github.com/delucis)! - Fixes an issue using components containing scripts inside Starlight’s steps component in versions of Astro >= 5.16.9
|
|
8
|
+
|
|
3
9
|
## 0.37.6
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -12,7 +12,16 @@ const stepsProcessor = rehype()
|
|
|
12
12
|
.data('settings', { fragment: true })
|
|
13
13
|
.use(function steps() {
|
|
14
14
|
return (tree: Root, vfile: VFile) => {
|
|
15
|
-
const rootElements = tree.children.filter(
|
|
15
|
+
const rootElements = tree.children.filter(
|
|
16
|
+
(item): item is Element =>
|
|
17
|
+
item.type === 'element' &&
|
|
18
|
+
// Since Astro 5.16.9, `<script>` elements from nested child elements can end up hoisted
|
|
19
|
+
// into the `<Steps>` slot due to our use of `Astro.slots.render()`. We can safely ignore
|
|
20
|
+
// these, so we filter them out here.
|
|
21
|
+
// TODO: we may be able to remove this in the future if the upstream issue is fixed.
|
|
22
|
+
// See: https://github.com/withastro/astro/issues/15627
|
|
23
|
+
item.tagName !== 'script'
|
|
24
|
+
);
|
|
16
25
|
const [rootElement] = rootElements;
|
|
17
26
|
|
|
18
27
|
if (!rootElement) {
|