Hello,
I have a problem when I use your lib.
When I try to parse simple Css like this one font-style: 'times new roman', serif;
your lib replaces the single quote by double quotes and give me this code font-style: "times new roman", serif;
.
May I am doing something wrong?
Can you help me?
Thank you so much.
Anonymous
Hi Jerome,
as far as i can see you are doing nothng wrong :-)
cssparser is at the core a parser for css files - means cssparser is able to read cssfiles and build a matching object graph. You can then do some traversal on top of the graph or whatever comes to your mind. And there is also a simple kind o dump the graph back as string functionality but this creates some kind of normalized string out of the graph. Part of normalization is to include all strings in double quotes.
Maybe you can tell me a bit more about your use case and your requirements and i will check if i can enhance the code a bit.
Hello,
we are doing some css cleaning of the style attribute and we send something like that
style="font-style: 'times new roman', serif;"
your lib change the style attribute tofont-style: "times new roman", serif
. It causes us some problems.Hello, do you have update about that?
Sorry not really. The information about the used quotation style gets lost during the parse process.
But you can trust the normaliztation to always use double quotes for string values.
Why not using this and always replace the style attribute with the reformated ones using single quote.
As an alternative i can offer a formatter option to include strings in single quotes.
Hello
Yes it could be great, thank you so much.
Last edit: Jérome LE BARON 2019-09-03
Sorry this was forgotten somehow. The next release will include this.