A somewhat better working version of this filter (thanks to altosax for the help):
Name = "Close stylesheet comments (1)"
Active = TRUE
Multi = TRUE
URL = "$TYPE(htm)"
Bounds = "$NEST(<style,</style>)"
Limit = 1500
Match = "1</style>"
"&$SET(2=//-->)"
Replace = "12
"
"</style>"
Name = "Close stylesheet comments (2)"
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "$NEST(<style,</style>)"
Limit = 1500
Match = "1--> //-->
"
"</style>"
Replace = "1 //-->
"
"</style>"
Filter 1 adds the closing comment to all stylesheets, and filter 2 removes any doubles. (As this may cause problems with some sites). It's still far from perfect (The filter should only work if <!-- is present, but I haven't found a way to make that work yet), but it does the trick a lot better than the first version I posted.
Edited by - Jor on 26 Apr 2002 15:01:45
hi jor.
it was a hard work but finally i've reached the end =D
i've posted these two filters (the one you required and the one required by hpguru) in the same message because the trick they use is the same, so i've developed them at the same time.
Name = "Close stylesheet comments" never worked this way ;)
Active = TRUE
URL = "$TYPE(htm)"
Bounds = "$NEST(<style,</style>)"
Limit = 2048
Match = " (-->*)1| (</style>)2$SET(1=//-->)"
Replace = " 1
2"
Name = "Add </head> tag when missing" improved to match also frameset
Active = TRUE
URL = "$TYPE(htm)"
Limit = 12
Match = "(</head>)1$STOP()|(<body|<frameset)2$SET(1=</head>)"
Replace = "12"
NOTE1: don't add "Multi = TRUE" otherwise the filter matches itself.
NOTE2: i've tried to test it on your test2 page, why you removed it?
regards,
altosax.