Swaagie / minimize

Minimize HTML
MIT License
162 stars 18 forks source link

Don't remove attribute quotes if value contains `<` or `>` #62

Closed rahatarmanahmed closed 8 years ago

rahatarmanahmed commented 8 years ago
$ minimize '<img src="whatever.png" alt="<cool>">'

  Minimize HTML

  Using content from the CLI
  Minimizing content...
  Finished processing content

  =========================================

<img src=whatever.png alt=<cool>>

Removing quotes from that alt parameter exposes the angle brackets, screwing up the HTML causing browsers to parse the last > as a text node. I could use the option to not remove quotes but it would be nice if it was smart enough to keep quotes if they contain < or >.

Swaagie commented 8 years ago

Thanks for reporting, fix released with 1.7.2