Skip to content

Commit

Permalink
Merge pull request #50 from jonathantneal/jn/use-span-fallback
Browse files Browse the repository at this point in the history
feat: use <span> to wrap fallback, prevent parsing issues
  • Loading branch information
bholmesdev authored Mar 18, 2024
2 parents 12bbf6c + 25bf781 commit 0c88e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/tender-balloons-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"simple-stack-stream": patch
---

Change Suspense wrapper from a `<div>` to a `<span>`. This ensures inline HTML content is correctly parsed.
4 changes: 2 additions & 2 deletions packages/stream/components/Suspense.astro
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ const result = await Astro.locals.suspend(() => Astro.slots.render("default"));
result.render === "fallback" && (
<>
<Fragment set:html={fallbackMarkerStart(result.id)} />
<div style="display: contents" data-suspense-fallback={result.id}>
<span style="display: contents" data-suspense-fallback={result.id}>
<slot name="fallback" />
</div>
</span>
<Fragment set:html={fallbackMarkerEnd(result.id)} />
</>
)
Expand Down

0 comments on commit 0c88e91

Please sign in to comment.