Astro Info
Astro v7.1.3
Node v24.16.0
System Windows (x64)
Package Manager bun
Output static
Adapter none
Integrations @sentry/astro
@spotlightjs/astro
astro-icon
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
i have a custom <details> wrapper which uses a <pre> inside because i want to include content with its line breaks intact, so i use a slot inside the <pre>, like this (the example includes some extra styling i use):
---
// src/components/Dropdown.astro
const { title } = Astro.props;
---
<details aria-label="details">
<summary>{title}</summary>
<pre><slot /></pre></details>
so, when using this component and its slot in other files, like so:
<Dropdown title="Pre in custom component">
First line
Second line
</Dropdown>
the newlines are not respected:

however, if the <pre> tag is removed from the component:
---
// src/components/DropdownNoPre.astro
const { title } = Astro.props;
---
<details aria-label="details">
<summary>{title}</summary>
<slot /></details>
and the tag is provided to the component like this:
<DropdownNoPre title="Pre outside component (in slot)"><pre>
First line
Second line
</pre></DropdownNoPre>
then, it works as expected:

What's the expected result?
the newlines are equally respected in both components, like so:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-48f6wvvv?file=src%2Fpages%2Findex.astro
Participation
Astro Info
If this issue only occurs in one browser, which browser is a problem?
No response
Describe the Bug
i have a custom
<details>wrapper which uses a<pre>inside because i want to include content with its line breaks intact, so i use a slot inside the<pre>, like this (the example includes some extra styling i use):so, when using this component and its slot in other files, like so:
the newlines are not respected:

however, if the
<pre>tag is removed from the component:and the tag is provided to the component like this:
then, it works as expected:

What's the expected result?
the newlines are equally respected in both components, like so:
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-48f6wvvv?file=src%2Fpages%2Findex.astro
Participation