Post Reply 
Google Alt Disp - prox-config-sidki_2011-12-22rc1
Feb. 17, 2012, 08:57 AM (This post was last modified: Feb. 17, 2012 09:06 AM by sbk.)
Post: #4
RE: Google Alt Disp - prox-config-sidki_2011-12-22rc1
isn't it possible add an alert ../help/Matching%20Commands.html#ALERT ?

or add an ../help/Matching Commands.html#ADDLST to that part of the match?
then check the ADDLST file after a month Smile!


semi-threadjack warning.. :-)

A while ago, I was trying to fix bad styles on a horribly stubborn webpage. i noticed an inline !important in the page. So I made a simple filter to erase the idiot's !important
I first wrote an ALERT into this:
Code:
Name = "CleanImportantCss[Sbk20111217T1a4"
Active = TRUE
Multi = TRUE
URL = "$TYPE(css)"
Bounds = "([a-z -]+\:[^!]+)\1 ! important"
Limit = 512
Match = "*"
Replace = "\1"
But during the next few hours, the alert annoyed me too often, so i deleted the ALERT.
I could have edited the filter to create a ADDLST log, but I don't think there's somewhere to send the (long) output.

PS. the filter's a bit loose, since it doesn't check if !important is inside style brackets or double quotes. I think a better filter would follow something like:
Code:
<style*>
[^<]+
([a-z -]+\:[^!]+)\1 ! important
*
</style>

or if checking for inline:
Code:
<[^ ]+\s*++style\=\"*++([a-z -]+\:[^!]+)\1 ! important[^"]+\"*>

but I dreaded hours of debugging.. Sad

someday I'll be reading a webpage discussing !important, and the sample code won't make sense. And maybe I'll send an email (no, don't!) to the website stating such. Oops. Big Teeth
Add Thank You Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Google Alt Disp - prox-config-sidki_2011-12-22rc1 - sbk - Feb. 17, 2012 08:57 AM

Forum Jump: