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

Unified Diff: chrome/content/elemHideEmulation.js

Issue 29367031: Issue 4684 - Allow { and } in attribute and property selectors (Closed) Base URL: https://bitbucket.org/fhd/adblockpluscore
Patch Set: Created Dec. 9, 2016, 2:07 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 | lib/filterClasses.js » ('j') | lib/filterClasses.js » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/elemHideEmulation.js
===================================================================
--- a/chrome/content/elemHideEmulation.js
+++ b/chrome/content/elemHideEmulation.js
@@ -132,17 +132,18 @@
var match = propertySelectorRegExp.exec(pattern.selector);
if (!match)
continue;
var propertyExpression = match[2];
var regexpString;
if (propertyExpression.length >= 2 && propertyExpression[0] == "/" &&
propertyExpression[propertyExpression.length - 1] == "/")
- regexpString = propertyExpression.slice(1, -1);
+ regexpString = propertyExpression.slice(1, -1)
+ .replace("\\x7B", "{").replace("\\x7D", "}");
Wladimir Palant 2016/12/13 14:32:16 This will incorrectly replace \x7B1234 which is a
Felix Dahlke 2016/12/13 16:04:48 Done.
else
regexpString = filterToRegExp(propertyExpression);
this.patterns.push({
text: pattern.text,
regexp: new RegExp(regexpString, "i"),
prefix: pattern.selector.substr(0, match.index),
suffix: pattern.selector.substr(match.index + match[0].length)
« no previous file with comments | « no previous file | lib/filterClasses.js » ('j') | lib/filterClasses.js » ('J')

Powered by Google App Engine
This is Rietveld