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

Side by Side Diff: lib/filterClasses.js

Issue 29367031: Issue 4684 - Allow { and } in attribute and property selectors (Closed) Base URL: https://bitbucket.org/fhd/adblockpluscore
Patch Set: Created Dec. 8, 2016, 10:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2016 Eyeo GmbH 3 * Copyright (C) 2006-2016 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 /** 78 /**
79 * Cache for known filters, maps string representation to filter objects. 79 * Cache for known filters, maps string representation to filter objects.
80 * @type Object 80 * @type Object
81 */ 81 */
82 Filter.knownFilters = Object.create(null); 82 Filter.knownFilters = Object.create(null);
83 83
84 /** 84 /**
85 * Regular expression that element hiding filters should match 85 * Regular expression that element hiding filters should match
86 * @type RegExp 86 * @type RegExp
87 */ 87 */
88 Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?: [$^*]?=[^\(\)"]*)?\))*)|#([^{}]+))$/; 88 Filter.elemhideRegExp = /^([^\/\*\|\@"!]*?)#(\@)?(?:([\w\-]+|\*)((?:\([\w\-]+(?: [$^*]?=[^\(\)"]*)?\))*)|#((?:[^{}]|(?:\[[\w-]+[~|]?=(['"])[^'"]*?\6\]))+))$/;
Wladimir Palant 2016/12/08 12:36:19 This won't consider escaped quotation marks proper
89 /** 89 /**
90 * Regular expression that RegExp filters specified as RegExps should match 90 * Regular expression that RegExp filters specified as RegExps should match
91 * @type RegExp 91 * @type RegExp
92 */ 92 */
93 Filter.regexpRegExp = /^(@@)?\/.*\/(?:\$~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[ ^,\s]+)?)*)?$/; 93 Filter.regexpRegExp = /^(@@)?\/.*\/(?:\$~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[ ^,\s]+)?)*)?$/;
94 /** 94 /**
95 * Regular expression that options on a RegExp filter should match 95 * Regular expression that options on a RegExp filter should match
96 * @type RegExp 96 * @type RegExp
97 */ 97 */
98 Filter.optionsRegExp = /\$(~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[^,\s]+)?)*)$/ ; 98 Filter.optionsRegExp = /\$(~?[\w\-]+(?:=[^,\s]+)?(?:,~?[\w\-]+(?:=[^,\s]+)?)*)$/ ;
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 */ 971 */
972 function ElemHideEmulationFilter(text, domains, selector) 972 function ElemHideEmulationFilter(text, domains, selector)
973 { 973 {
974 ElemHideBase.call(this, text, domains, selector); 974 ElemHideBase.call(this, text, domains, selector);
975 } 975 }
976 exports.ElemHideEmulationFilter = ElemHideEmulationFilter; 976 exports.ElemHideEmulationFilter = ElemHideEmulationFilter;
977 977
978 ElemHideEmulationFilter.prototype = extend(ElemHideBase, { 978 ElemHideEmulationFilter.prototype = extend(ElemHideBase, {
979 type: "elemhideemulation" 979 type: "elemhideemulation"
980 }); 980 });
OLDNEW
« no previous file with comments | « no previous file | test/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld