mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
When searching allow use of uppercase locations
When searching allow use of uppercase location names, such as AUTHOR instead of author, automatically lowercasing them. Fixes #1192785 [search errors are replicated automatically](https://bugs.launchpad.net/calibre/+bug/1192785)
This commit is contained in:
parent
e533d7d218
commit
91b9bc6f0d
@ -240,8 +240,8 @@ class Parser(object):
|
||||
# the search string is something like 'author: "foo"' because it
|
||||
# will be interpreted as 'author:"foo"'. I am choosing to accept the
|
||||
# possible error. The expression should be written '"author:" foo'
|
||||
if len(words) > 1 and words[0] in self.locations:
|
||||
loc = words[0]
|
||||
if len(words) > 1 and words[0].lower() in self.locations:
|
||||
loc = words[0].lower()
|
||||
words = words[1:]
|
||||
if len(words) == 1 and self.token_type() == self.QUOTED_WORD:
|
||||
return ['token', loc, self.token(advance=True)]
|
||||
|
Loading…
x
Reference in New Issue
Block a user