Remove lines containing Adguard JavaScript rules from adlists (#5754)

This commit is contained in:
yubiuser 2024-09-23 23:33:14 +02:00 committed by GitHub
commit 564957c203
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -699,7 +699,7 @@ gravity_ParseFileIntoDomains() {
# 2) Remove carriage returns # 2) Remove carriage returns
# 3) Remove lines starting with ! (ABP Comments) # 3) Remove lines starting with ! (ABP Comments)
# 4) Remove lines starting with [ (ABP Header) # 4) Remove lines starting with [ (ABP Header)
# 5) Remove lines containing ABP extended CSS selectors ("##", "#!#", "#@#", "#?#") preceded by a letter # 5) Remove lines containing ABP extended CSS selectors ("##", "#$#", "#@#", "#?#") and Adguard JavaScript (#%#) preceded by a letter
# 6) Remove comments (text starting with "#", include possible spaces before the hash sign) # 6) Remove comments (text starting with "#", include possible spaces before the hash sign)
# 7) Remove leading tabs, spaces, etc. (Also removes leading IP addresses) # 7) Remove leading tabs, spaces, etc. (Also removes leading IP addresses)
# 8) Remove empty lines # 8) Remove empty lines
@ -708,7 +708,7 @@ gravity_ParseFileIntoDomains() {
-e 's/\r$//' \ -e 's/\r$//' \
-e 's/\s*!.*//g' \ -e 's/\s*!.*//g' \
-e 's/\s*\[.*//g' \ -e 's/\s*\[.*//g' \
-e '/[a-z]\#[$?@]{0,1}\#/d' \ -e '/[a-z]\#[$?@%]{0,3}\#/d' \
-e 's/\s*#.*//g' \ -e 's/\s*#.*//g' \
-e 's/^.*\s+//g' \ -e 's/^.*\s+//g' \
-e '/^$/d' "${destination}" -e '/^$/d' "${destination}"