kirby-blade icon indicating copy to clipboard operation
kirby-blade copied to clipboard

Broken HTML minification

Open S1SYPHOS opened this issue 2 years ago • 4 comments

Hey there, when turning on HTML minification, I get the following ParseError: syntax error, unexpected token ")"

Screenshot from 2022-06-24 12-00-55

When disabling HTML minification, everything works fine and behaves as expected (great plugin, thanks <3).

Now, even when just using <html></html> and nothing else. I know that it originates somewhere in symfony/css-selector and I can't figure out which ) and where it comes from - but it's certainly not from within my HTML being passed to kirby-blade.

S1SYPHOS avatar Jun 24 '22 10:06 S1SYPHOS

Which version do you use?

afbora avatar Jun 24 '22 10:06 afbora

Currently v1.9.2, but I tried earlier versions, and it's all the same ..

S1SYPHOS avatar Jun 24 '22 10:06 S1SYPHOS

.. disabling doOptimizeViaHtmlDomParser helps, but deactivates most optimization steps along with it :wink:

S1SYPHOS avatar Jun 24 '22 10:06 S1SYPHOS

I tried pinpointing the issue disabling everything except doOptimizeViaHtmlDomParser, but to no avail:

# ...
'afbora.blade.minify.options' => [
    'doOptimizeViaHtmlDomParser' => true,
    'doRemoveComments' => false,
    'doSumUpWhitespace' => false,
    'doRemoveWhitespaceAroundTags' => false,
    'doOptimizeAttributes' => false,
    'doRemoveHttpPrefixFromAttributes' => false,
    'doRemoveHttpsPrefixFromAttributes' => false,
    'doKeepHttpAndHttpsPrefixOnExternalAttributes' => false,
    // 'doMakeSameDomainsLinksRelative' => false,  # see issue #23
    'doRemoveDefaultAttributes' => false,
    'doRemoveDeprecatedAnchorName' => false,
    'doRemoveDeprecatedScriptCharsetAttribute' => false,
    'doRemoveDeprecatedTypeFromScriptTag' => false,
    'doRemoveDeprecatedTypeFromStylesheetLink' => false,
    'doRemoveDeprecatedTypeFromStyleAndLinkTag' => false,
    'doRemoveDefaultMediaTypeFromStyleAndLinkTag' => false,
    'doRemoveDefaultTypeFromButton' => false,
    'doRemoveEmptyAttributes' => false,
    'doRemoveValueFromEmptyInput' => false,
    'doSortCssClassNames' => false,
    'doSortHtmlAttributes' => false,
    'doRemoveSpacesBetweenTags' => false,
    'doRemoveOmittedQuotes' => false,
    'doRemoveOmittedHtmlTags' => false,
],
# ...

.. still throws ParseError :disappointed:

S1SYPHOS avatar Jun 25 '22 09:06 S1SYPHOS