add trusted pseudo-classes argument#39
add trusted pseudo-classes argument#39tbicr wants to merge 1 commit intopeterbe:masterfrom tbicr:trusted_pseudoclasses
Conversation
premailer/premailer.py
Outdated
There was a problem hiding this comment.
I don't like the word "trusted". If that's the parameter name I'd expect the value to be a list of pseudo classes. Like:
trusted_pseudoclasses=[':foo', ':bar']
...or something.
Perhaps you mean to call it trust_pseudoclasses=False which would make it a verb.
There was a problem hiding this comment.
Note how the parameter in that same signature is exclude_pseudoclasses. "verb_noun"
There was a problem hiding this comment.
Why would it be False by default?
Looking at your added unit test, it looks like a really useful feature that isn't controversial.
The reason exclude_pseudoclasses is True by default is because you can't keep pseudo classes in style attributes so keeping them is kinda silly.
|
Your code has diverged from master. Can you rebase up your code and push back into the pull request? |
|
I rebase code, fix
|
|
Great work! I'm currently a bit swamped as tomorrow is the start of the new quarter but I've starred this on my todo list and I'll try to see what I can do to make it work again. |
There was a problem hiding this comment.
What version of lxml added SelectorError?
Once we know that setup.py needs to be modified and look something like lxml>=x.y.z
There was a problem hiding this comment.
SelectorError available in lxml=>3.0 version.
|
Test fail quite hard. Would you mind looking at that first? |
It useful to wide cssselect pseudo-classes support like `:not()`, `:nth-child()`, `:nth-last-child`, `:nth-of-type()`, `:nth-last-of-type()` and etc. For this case pseudo-classes as `:hover`, `:active` and etc. will processed but not left in style attribute, so you must use for this `keep_style_tags` argument.
|
As I said before issue in code I created issue for PS. I fixed |
|
Any chance we can revive this? |
It useful to wide cssselect pseudo-classes support like
:not(),:nth-child(),:nth-last-child,:nth-of-type(),:nth-last-of-type()and etc. For this case pseudo-classes as:hover,:activeand etc. will processed but not left in style attribute, so you must use for thiskeep_style_tagsargument.