-
Notifications
You must be signed in to change notification settings - Fork 92
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
full CSS is escaped if a style definition seems invalid #117
Comments
@spassarop - Hey - this question is for you :-) |
Hi @optyler, I'll answser by parts:
Partially, explained next.
Kind of. You cannot provide a prefix itself and there is no separate option. The supported solution for this is to add the whole attribute to the policy. Here is an example to support <css-rules>
...
<property name="mso-line-height-rule" description="Vendor property.">
<category-list>
<category value="visual" />
</category-list>
<literal-list>
<literal value="exactly" />
</literal-list>
</property>
</css-rules>
No, I wish that exists. When the CSS parser (Batik-CSS library) encounters and reports an error, it leaves its internal "cursor" in a state that results in ending the CSS parse process. Although AntiSamy can override methods for certain parsing events, it cannot influence on how the parsing is done :(
The parser tries to validate them, it is supported. But I just don't know if the parser is bad/outdated or people use non-standard media definitions. Anyway, the support for this from Batik-CSS seems to be very basic, it was pointed out in #108. Sorry we can't provide a better solution for this :/ |
Great answer, thanks for the full explanation :) We will look on how we could improve / address our issues with those new data. Thank again |
Related to #293 |
Hi guys.
I don't know if this is a bug or just a lack of knowledge about the options... so, sorry if i'm in the wrong place.
I'm writing for my company a newsletter template that is filled with documents and render on an admin webpage. Administrators can then edit the pre-rendered newsletter and edit it, if they want, in a richtext box, before sending to the customers. So, when they save their changes, we
POST
the full modified html, check it with antisamy, and save it in DB.If you ever worked to produce newsletters, you know we have to put tons of css for each kind of mail clients, use specific vendor prefixes, all sort of media queries and so on...
Here is the content of a
style
tag inserted in thehead
of my document.After validation, the CSS was truncated after the first "non standard" property.
Here is the result :
All the content after
mso-line-height-rule: exactly;
has disappeared.Here are my questions :
@media only screen and (max-width: 480px) {
)Thanks
The text was updated successfully, but these errors were encountered: