compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Minifiy newline with link and div elements

Open wildfiremedia opened this issue 1 year ago • 0 comments

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.

wildfiremedia avatar Jul 10 '24 12:07 wildfiremedia