Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: lib/abp2blocklist.js

Issue 29467595: Issue 5325 - Add support for separator characters (Closed) Base URL: https://hg.adblockplus.org/abp2blocklist
Patch Set: Created June 16, 2017, 5:25 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/abp2blocklist.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/abp2blocklist.js
===================================================================
--- a/lib/abp2blocklist.js
+++ b/lib/abp2blocklist.js
@@ -144,17 +144,20 @@
switch (c)
{
case "*":
if (regexp.length > 0 && i < lastIndex && text[i + 1] != "*")
regexp.push(".*");
break;
case "^":
if (i < lastIndex)
- regexp.push(".");
+ regexp.push("[^.%A-Za-z0-9_]");
+ else
+ regexp.push("([^.%A-Za-z0-9_].*)?$");
Sebastian Noack 2017/06/16 21:13:18 Can you put the duplicated part of the regexp in a
Manish Jethani 2017/06/19 10:39:54 Done.
+ canSafelyMatchAsLowercase = false;
Sebastian Noack 2017/06/16 21:13:18 Why is that necessary?
Manish Jethani 2017/06/19 10:39:54 It was converting "A-Z" into "a-z". I thought abou
break;
case "|":
if (i == 0)
{
regexp.push("^");
break;
}
if (i == lastIndex)
« no previous file with comments | « no previous file | test/abp2blocklist.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld