-
Notifications
You must be signed in to change notification settings - Fork 80
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
Issues with quotes in inline styles and image backgrounds #28
Comments
The fastest would be if you could make a PR with a simple test reproducing your issues. |
+1 My first guess is that it has to do with the split(:) in createStyleJsonFromString in utils.js so a style definition like "background-image: url(http://mydomain.com/file.jpg)" is being broken up. |
I ran into the same thing. Fails with URLs as well as inlined base64 images:
|
The error occurs in
|
Could someone submit a PR including a simple test please? It'd be resolved faster like this. |
Fixed by #31, thanks @brett-nuske-alliancesoftware! |
This little snippet does a great job reconciling ReactJS with any static HTML from the server without having to use NodeJS server rendering -although that would be the best thing to do- however, not in my case since I am using Drupal as the back-end and I simply need to get the server produced HTML, combine it with ReactJS components and create a new components tree. The webpage works even without JS (as an edge case). But I'm having some issues with inline styles and quotes escaping, more exactly when I pass in a static image URL to the background property of a div:
The HTML
The error
The component
As you can see this is trimming the URL and removing everything after the first
:
, therefore the URL address which should be treated as an external URL is being treated as a relative path. Any ideas of what's going on? I guess it has to do with escaping issues.The text was updated successfully, but these errors were encountered: