redux-framework icon indicating copy to clipboard operation
redux-framework copied to clipboard

css content property issue on ace editor

Open genethic opened this issue 12 years ago • 6 comments

Hi!

When I use the content property of CSS on the Ace editor like this:

.caption-wrap .line-5 a:nth-child(1):after { content:"\f005"; }

And save, it set automatically to:

.caption-wrap .line-5 a:nth-child(1):after { content:"f005"; }

it adds extra dash before quotes ( an remove my dash..). I have to escape quotes? how? o is an editor issue?

Thanks in advance!

genethic avatar Jul 20 '14 13:07 genethic

https://github.com/ReduxFramework/redux-framework/blob/master/CONTRIBUTING.md

kprovance avatar Jul 20 '14 16:07 kprovance

Whatever is doing this is happening before the css validation, and saving as such to the database. @Dovy may have a better idea if it's the editor itself or some tricksy thing in the core. If there is, I can;t find it.

kprovance avatar Jul 21 '14 00:07 kprovance

Experienced this first time I used redux,

I was able to avoid this issue by disabling the css validator, removing 'validate' => 'css' on field array

SilverKenn avatar Jul 21 '14 10:07 SilverKenn

Confirmed. Remove the 'validate' => 'css' line, and it'll save properly. If you have the ACE editor set to CSS mode, it should catch bad CSS before saving and give you and X image where the bad CSS is.

kprovance avatar Jul 21 '14 18:07 kprovance

it works if I remove 'validate' => 'css', but I want to validate the css... this solution doesn't seems to be the best.

genethic avatar Jul 21 '14 20:07 genethic

All out validate class does is run the returned string through the wp_filter_nohtml_kses function. That's it. Since it's not properly dealing with the quotes in the string, commenting it out would be the exact same thing as not using the validation to begin with. So, pick your solution, they're both the same.

kprovance avatar Jul 22 '14 01:07 kprovance