mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
17b812ea31
commit
ced585923f
@ -58,6 +58,8 @@ spat = regex.compile(r'(\s+)')
|
|||||||
def text_to_regex(text):
|
def text_to_regex(text):
|
||||||
has_leading = text.lstrip() != text
|
has_leading = text.lstrip() != text
|
||||||
has_trailing = text.rstrip() != text
|
has_trailing = text.rstrip() != text
|
||||||
|
if text and not text.strip():
|
||||||
|
return r'\s+'
|
||||||
ans = []
|
ans = []
|
||||||
for wpart in spat.split(text.strip()):
|
for wpart in spat.split(text.strip()):
|
||||||
if not wpart.strip():
|
if not wpart.strip():
|
||||||
|
Loading…
x
Reference in New Issue
Block a user