Opened 14 months ago

Closed 6 months ago

#6770 closed change (duplicate)

Allow the "s" flag in :-abp-contains() regular expressions

Reported by: mapx Assignee: hfiguiere
Priority: Unknown Milestone:
Module: Unknown Keywords:
Cc: mjethani, kzar, hfiguiere, arthur, greiner Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by mapx)

Environment

firefox / chrome widows 7/10
last ABP dev build

How to reproduce

go to
https://www.quora.com/Is-China-safe-for-tourists

quora is using 2 spaces between "ad" and "by"

a filter like (2 spaces ! between ad and by) :

quora.com#?#[id*=wrapper]:-abp-contains(/ad  by/i)

is working

but it would be much better supporting a filter like:
quora.com#?#[id*=wrapper]:-abp-contains(/ad\s{1,}by /i)

Observed behaviour

\s is not supported by abp-contains

Expected behaviour

implement \s flag

Notes

uBo is supporting such flag, for example
quora.com##[id*=wrapper]:has-text(/ad\s{1,}by /i)

Change History (8)

comment:1 Changed 14 months ago by mapx

  • Description modified (diff)

comment:2 Changed 14 months ago by mapx

  • Type changed from defect to change

comment:3 Changed 14 months ago by hfiguiere

I am actually surprised. There is even a test where we use the following RegExp /to\shide/

I'll investigate further.

comment:4 Changed 14 months ago by mapx

  • Description modified (diff)

comment:5 Changed 14 months ago by mjethani

I have not confirmed, but this is probably not working because of the CSS escaping, which we want to get rid of (#6726). /ad\s{1,}by/ doesn't work but /ad\s+by/ works.

comment:6 Changed 14 months ago by hfiguiere

  • Owner set to hfiguiere

comment:7 Changed 14 months ago by greiner

  • Cc greiner added

comment:8 Changed 6 months ago by hfiguiere

  • Resolution set to duplicate
  • Status changed from new to closed

This was fixed with issue #7268

Note: See TracTickets for help on using tickets.