Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Despite minifyCss set to false, inlined styles gets modified #798

Closed
PEM-- opened this issue Apr 6, 2017 · 4 comments
Closed

Despite minifyCss set to false, inlined styles gets modified #798

PEM-- opened this issue Apr 6, 2017 · 4 comments

Comments

@PEM--
Copy link

PEM-- commented Apr 6, 2017

When minifying this with minifyCss: false:

<p style="background-color:blue;color:red;">Test</p>

The output is changed and the last ; in the inline style gets removed leading to reconciliation errors in React. While removing the last ; is a neat feature, when the minifyCss is false, the inline style should not be altered.

Referenced errors:

@alexlamsl
Copy link
Collaborator

Sounds reasonable - PR is welcomed.

@petermikitsh
Copy link

petermikitsh commented May 1, 2017

This creates integration issues with react server-sider rendering. Right now, I'm only observing those issues in Firefox. The markup is reusable in Chrome + Safari.

Warning: React attempted to reuse markup in a container but the checksum was invalid. This generally means that you are using server rendering and the markup generated on the server was not what the client was expecting. React injected new markup to compensate which works but you have lost many of the benefits of server rendering. Instead, figure out why the markup being generated is different on the client or server:
 (client) ="background:#0C8DCE;" data-reactid="5">
 (server) ="background:#0C8DCE" data-reactid="5"><

I guess those trailing semicolons do matter.

@buildbreakdo
Copy link

@petermikitsh Have this issue in Chrome as well. Unclear how to configure html-minifier to leave trailing semicolon alone in the style attribute, @alexlamsl is the referenced issue a proposed fix?

@DChristiany
Copy link
Contributor

I have created a fork (found here: https://github.com/DChristiany/html-minifier), that offers a configuration option, that does not remove trailing semicolons.
Should I just create a Pull Request (sorry, i'm new to working on open source projects).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants