gearsdigital / kirby-analytics-dashboard

Kirby Analytics Dashboard is a Kirby 2 plugin which extends your dashboard with some Google Analytics statistics and reports.
MIT License
41 stars 4 forks source link

Unexpected token < if kirby-html-minifier is installed #5

Closed gearsdigital closed 6 years ago

gearsdigital commented 6 years ago

As reported in the Kirby forums, there is an javascript error if the kirby-html-minifier plugin is installed and enable. It says Uncaught SyntaxError: Unexpected token <.

gearsdigital commented 6 years ago

After little debugging I figured out what happens. The plugin uses a trivial delimiter < to extract html tags.

Under the hood it makes use of Kirby\Component\Response which builds and returns the response by various inputs. I don't know exactly why – but somehow the component seems to handle JS and CSS responses individually and I think it should exclude such types.

Currently there is no fix for that but I opened an PR over there which targets this issue.

gearsdigital commented 6 years ago

I'll close this issue here because the code base of kirby-analytics-dashboard is not directly affected.