-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
compressHTML
removes whitespace that should not be removed
#7556
Comments
Oh, I think this is actually a compiler issue since it's the one that does the compressing. |
Reopened as withastro/compiler#815 |
The fix for that has not been released yet, has it? |
That issue was fixed 👍 |
I am using Astro v3.1.2
and the following HTML code <p class="card-text fw-light">Im Sommersemester 2023 leite ich
die beiden <a href="/veranstaltungen/">Veranstaltungen</a> <strong
class="fw-normal">Programmierung 2</strong> und <strong
class="fw-normal">Software-Entwicklungsprozesse</strong>.</p> compiles to: <p class="card-text fw-light">Im Sommersemester 2023 leite ich
die beiden <a href="/veranstaltungen/">Veranstaltungen</a><strong class="fw-normal">Programmierung 2</strong> und <strong class="fw-normal">Software-Entwicklungsprozesse</strong>.</p> As you can see, the whitespace between Thus, that HTML code is rendered as: Im Sommersemester 2023 leite ich die beiden VeranstaltungenProgrammierung 2 und Software-Entwicklungsprozesse. Between Any ideas what could cause that issue? |
Quick update: If I explicitly disable the |
What version of
astro
are you using?2.7.3
Are you using an SSR adapter? If so, which one?
None
What package manager are you using?
pnpm
What operating system are you using?
Linux (NixOS)
What browser are you using?
Firefox (Librewolf)
Describe the Bug
compressHTML
removes whitespace that should not be removed, even in minification. I haven't been able to determine in exactly what circumstances it does this, but it happens in both dev and production.Here's an example:
compressHTML
false
true
The whitespace is not removed if "B" is also text. I have several more examples in the repo I provided.
What's the expected result?
compressHTML
should not erroneously remove whitespace.Link to Minimal Reproducible Example
https://gitlab.com/wackbyte/astro-compress-html-removes-whitespace
Participation
The text was updated successfully, but these errors were encountered: