Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
Called very early when we are detecting the format
"""
# Check for the Adblock Plus header
- if line == "[Adblock Plus]" or line.startswith("!") or line.startswith("||"):
+ if line in ("[Adblock Plus]", "[Adblock Plus 2.0]"):
+ return Format.ADBLOCKPLUS
+
+ # Sometimes we don't have a header, but we will see comments or the first domain
+ elif line.startswith("!") or line.startswith("||"):
return Format.ADBLOCKPLUS
# Is this a hosts file?