renatomarinho / laravel-page-speed

Package to optimize your site automatically which results in a 35%+ optimization
MIT License
2.4k stars 275 forks source link

InlineCss misses space and thus breaks styles #159

Open jaulz opened 2 years ago

jaulz commented 2 years ago

Detailed description

When using InlineCss middleware I noticed that the middleware misses a space and in the example below you can see how there is no space between the data attribute and the class attribute. Does that maybe happen because the data attribute is empty?

Without middleware:

<main class="flex-1 space-y-4" style="flex-grow:8;" data-v-c064ebb4="">
</main>

With middleware:

<main data-v-c064ebb4class="flex-1 space-y-4 page_speed_1184082138">
</main>

Context

Currently, it breaks the styles because the class attribute is not recognized.

Possible implementation

Not sure yet how to solve it properly...

Your environment

Include as many relevant details about the environment you experienced the bug in and how to reproduce it.