Minification strips attribute value of `hx-boost=true` to just `hx-boost`, breaking functionality
Are you using the latest verion of NUglify, especially if used through BunderMinifier? Update before raising a bug as your issue is probably already fixed.
I am using NUglify 1.21.15 through PSParseHTML (HtmlTinkerX)
Describe the bug
The HTMX library features an element attribute hx-boost. This attribute must have a value of either "true" or "false" to function properly; blank values are effectively "false" and disable the expected functionality of the attribute.
To Reproduce First, install PSParseHTML with
Install-Module -Name PSParseHTML
Now, using Optimize-HTML, run the following command:
"<a hx-boost=true >" | Optimize-HTML
This should output
<a hx-boost=true></a>
Excepted output code The following incorrect HTML is emitted instead, breaking the expected functionality of the library:
<a hx-boost></a>
similar: https://github.com/trullock/NUglify/issues/230
This seems to be the intended purpose of HtmlSettings.ShortBooleanAttribute. I didn't scroll down far enough in the HtmlSettings.cs file!
This is an easy fix, theres a list of excluded attributes in the html minifier
Send a PR