mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Merge pull request #769 from abdnh/escape-sidebar-terms
Escape browser sidebar search terms
This commit is contained in:
commit
49ebb193cf
1 changed files with 2 additions and 1 deletions
|
@ -5,6 +5,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import html
|
import html
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
@ -1219,7 +1220,7 @@ QTableView {{ gridline-color: {grid} }}
|
||||||
if c % 2 == 0:
|
if c % 2 == 0:
|
||||||
txt += a + ":"
|
txt += a + ":"
|
||||||
else:
|
else:
|
||||||
txt += a
|
txt += re.sub(r"(\*|%|_)", r"\\\1", a)
|
||||||
for chr in " ()":
|
for chr in " ()":
|
||||||
if chr in txt:
|
if chr in txt:
|
||||||
txt = '"%s"' % txt
|
txt = '"%s"' % txt
|
||||||
|
|
Loading…
Reference in a new issue