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

Minifiy newline with link and div elements #1018

Open
1 task
wildfiremedia opened this issue Jul 10, 2024 · 0 comments
Open
1 task

Minifiy newline with link and div elements #1018

wildfiremedia opened this issue Jul 10, 2024 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@wildfiremedia
Copy link

Astro Info

stro                    v4.11.5
Node                     v20.15.0
System                   macOS (arm64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/tailwind

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

If div is in link element, it will create new line, and preserve whitespace.

    <a href="">
         <div>hello</div>
    </a>
    <a href="">
         <div>hello</div>
    </a>

is being minified as

    <a href=""> <div>hello</div> </a>
    <a href=""> <div>hello</div> </a>

What's the expected result?

Could be further optimise?

<a href=""> <div>hello</div> </a> <a href=""> <div>hello</div> </a>

I know this can only check after running build output, so I shall skip creating test files.

Link to Minimal Reproducible Example

NA

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Jul 10, 2024
@florian-lefebvre florian-lefebvre transferred this issue from withastro/astro Jul 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants
@wildfiremedia and others