Closed cristianoveiga closed 7 years ago
Hello,
What is your version of refinery?
It could be the HTML sanitizer.
Did you see any warning in your rails server log?
Hello Brice,
I'm using refinerycms (3.0.4).
You are right, it's the Sanitizer (see attached).
Do you have any idea how can I deal with it ?
Thanks,
Cristiano
The best is to not have inline CSS.
I don't know why it does not allow style
this attribute is present in Loofah::HTML5::WhiteList
: https://github.com/flavorjones/loofah/blob/v2.0.3/lib/loofah/html5/whitelist.rb#L78
What happens if you add a ;
at the end of the CSS definition ?
Well,
I usually try to not to put inline CSSs most of the times, but for this case I don't see any alternative.
The context is: I wanna be able to customize the background image of some divs in my pages.
I tried to put the ; but I got the same behaviour:
Any ideas ?
Thanks again !
Did you find the solution?
Hi Brice,
Not yet.
Do you have any suggestion ?
Thanks.
On a refinerycms (3.0.3)
project, i have:
[...]
.row
- if post.images.any?
.img.mobile style="background-image:url(#{post.images.first.thumbnail(geometry: "720x224").url});"
.img.desktop style="background-image:url(#{post.images.first.thumbnail(geometry: "270x200").url});"
[...]
And inline style
works well.
You probably have a problem in your code.
Could you show me your view ?
Is it fixed for you ?
Hi Brice,
Sorry for not replying before.
Actually I'm no longer working on this project/company.
In the end, we gave up using Refinery for that purpose.
Thank you so much for your time and feel free to close the issue.
Cristiano
@cristianoveiga thanks for your answer, i close this issue because i'm not able to reproduce the error.
Hello,
I've installed Refinery on my existing Rails 4.2 application.
Everything works well, except for the following situation:
When I add a div and set a background image, for some reason the HTML generated in the final page has a malformed tag (see attached image).
It's weird because it works for some other CSS attributes/properties, for example: CSS class and width/height.
Please, could you help me with this issue ?
Thank you.
Cristiano Veiga