From 0ad2a79624a3f2365acabf9fe234e4325aa8e2fe Mon Sep 17 00:00:00 2001 From: yubiuser Date: Fri, 6 Sep 2024 21:20:36 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Adam Warner Signed-off-by: yubiuser --- gravity.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gravity.sh b/gravity.sh index 7d1358f2..dce387f5 100755 --- a/gravity.sh +++ b/gravity.sh @@ -699,7 +699,6 @@ gravity_ParseFileIntoDomains() { # 3) Remove lines starting with ! (ABP Comments) # 4) Remove lines starting with [ (ABP Header) # 5) Remove lines containing ABP extended CSS selectors ("##", "#!#", "#@#", "#?#") preceded by a letter - # 6) Remove lines containing Adguard JavaScript rules ("#%#") preceded by a letter # 7) Remove comments (text starting with "#", include possible spaces before the hash sign) # 8) Remove leading tabs, spaces, etc. (Also removes leading IP addresses) # 9) Remove empty lines @@ -708,8 +707,7 @@ gravity_ParseFileIntoDomains() { -e 's/\r$//' \ -e 's/\s*!.*//g' \ -e 's/\s*\[.*//g' \ - -e '/[a-z]\#[$?@]{0,1}\#/d' \ - -e '/[a-z]\#%\#/d' \ + -e '/[a-z]\#[$?@%]{0,3}\#/d' \ -e 's/\s*#.*//g' \ -e 's/^.*\s+//g' \ -e '/^$/d' "${destination}"