philhawksworth / netlify-plugin-minify-html

26 stars 8 forks source link

Removes space surrounding links #8

Closed ItaiAxelrad closed 4 years ago

ItaiAxelrad commented 4 years ago

The plugin appears to remove white space surrounding link tags. This results in what looks like a concatenated string with the link text in the middle.

Lukasvo commented 4 years ago

I see this too. Disabling the plugin because of this.

philhawksworth commented 4 years ago

Under the hood, this plugin uses this html-minifier

You can pass it various configurations in the netlify.toml. Perhaps there is a corresponding option here which will resolve that?

https://github.com/kangax/html-minifier#options-quick-reference

hlorand commented 4 years ago

Add the following code in a netlify.toml file in your repository root to override default settings:

[[plugins]]
  package = "netlify-plugin-minify-html"

  [plugins.inputs]
    contexts = [
      'production',
      'branch-deploy',
      'deploy-preview'
    ]

  [plugins.inputs.minifierOptions]
    collapseInlineTagWhitespace = false
philhawksworth commented 4 years ago

This is actually what is shown as the example in the readme for this plugin. If this setting does resolve things for you @ItaiAxelrad, I'll close this issue.

ItaiAxelrad commented 4 years ago

It does resolve the issue, my apologies for not seeing that earlier!

philhawksworth commented 4 years ago

Hooray! Thanks @ItaiAxelrad.