bezoerb/inline-critical

Incorrect handling of quotes in attributes

Closed this issue · 4 comments

Seems like quotes around attributes are being normalised. This is causing problems when using single quotes:

<div data-test='"test informaiton"'>

becomes

<div data-test="" test="" informaiton""="">

This is cheerio related.

any solution for this?

It breaks all the code inside EJS template:

<% let title= i18n.__('Name', name); %>
    <title><%= title %></title>

becomes this:

<%= let="" title="i18n.__('Name'," name);=""  %>

I think the only solution would be to inline the critical css yourself

Switched to jsdom and in the next release (already in master) inline-critical will only repalce the <head> section of the original html page with the one modified by jsdom. So as long as there isn't any EJS code inside everything should be fine