Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion adblockparser/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def rule_to_regex(cls, rule):

# other | symbols should be escaped
# we have "|$" in our regexp - do not touch it
rule = re.sub("(\|)[^$]", r"\|", rule)
rule = re.sub("(\|)(?!\$)", '\|', rule)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💄 I would add the r prefix to both strings instead of removing it, for future-proofing. But the suggested changes should work.

Suggested change
rule = re.sub("(\|)(?!\$)", '\|', rule)
rule = re.sub(r"(\|)(?!\$)", r'\|', rule)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's too long ago. I changed projects long ago. Do I have to accept the suggestions or could you do it as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can, don’t worry, and it’s not a deal breaker anyway. I’ll wait for a second approval, though.

PS: Thank you very much for your patch, I’m deeply sorry for the delay.


return rule

Expand Down