Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Meaningful whitespace collapsed with compressHTML: true #852

Open
delucis opened this issue Aug 15, 2023 · 0 comments · May be fixed by #916
Open

Meaningful whitespace collapsed with compressHTML: true #852

delucis opened this issue Aug 15, 2023 · 0 comments · May be fixed by #916
Assignees
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)

Comments

@delucis
Copy link
Member

delucis commented Aug 15, 2023

What version of @astrojs/compiler are you using?

1.8.1

What package manager are you using?

npm

What operating system are you using?

macOS / StackBlitz

Describe the Bug

Certain instances of inline whitespace appear to be collapsed with an impact on the visual result when using Astro’s new compressHTML: true config option.

Specifically this seems to be the case with expressions (e.g. {'string'}) and inline elements (e.g. <span> or <time>):

Input

<p>{'text'} <span>text</span></p>
<p><span>text</span> <span>text</span></p>

Actual output

<p>text<span>text</span></p>
<p><span>text</span><span>text</span></p>

Expected output

<p>text <span>text</span></p>
<p><span>text</span> <span>text</span></p>

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-obrxxu?file=src%2Fpages%2Findex.astro

@matthewp matthewp added the - P4: important Violate documented behavior or significantly improves performance (priority) label Aug 21, 2023
delucis added a commit to delucis/astro-badge that referenced this issue Oct 31, 2023
Fix visual regression caused by withastro/compiler#852
delucis added a commit to delucis/astro-badge that referenced this issue Oct 31, 2023
@MoustaphaDev MoustaphaDev self-assigned this Dec 20, 2023
@natemoo-re natemoo-re linked a pull request Dec 20, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P4: important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants