Skip to content

Commit e30914c

Browse files
committed
Fix: Unicode characters similar to ">" (#3027)
1 parent 2aff41a commit e30914c

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

module/base/filter.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,22 @@ def __init__(self, regex, attr, preset=()):
2020
self.filter = []
2121

2222
def load(self, string):
23+
"""
24+
Load a filter string, filters are connected with ">"
25+
26+
There are also tons of unicode characters similar to ">"
27+
> \u003E correct
28+
\uFF1E
29+
\uFE65
30+
\u203a
31+
˃ \u02c3
32+
\u1433
33+
\u276F
34+
"""
2335
string = str(string)
24-
self.filter_raw = [f.strip(' \t\r\n') for f in string.split('>')]
36+
string = re.sub(r'[ \t\r\n]', '', string)
37+
string = re.sub(r'[>﹥›˃ᐳ❯]', '>', string)
38+
self.filter_raw = string.split('>')
2539
self.filter = [self.parse_filter(f) for f in self.filter_raw]
2640

2741
def is_preset(self, filter):

0 commit comments

Comments
 (0)