mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
wrap non-english words in quotes
This commit is contained in:
parent
fe853451c5
commit
bf8d081161
1 changed files with 4 additions and 0 deletions
|
|
@ -9,6 +9,10 @@ export const parseSearchQuery = (query: string): LiqeQuery => {
|
|||
.replace(/(\w+):("([^"]+)"|([^")\s]+))/g, '$1:"$3$4"')
|
||||
// remove any quotes that are in the array value for example: label:"test","test2" -> label:"test,test2"
|
||||
.replace(/","/g, ',')
|
||||
// wrap non-english words in quotes if they are not already
|
||||
.replace(/([^":\s]+[\u0080-\uFFFF]+[^":\s]*)(?=\s|$|")/g, '"$1"')
|
||||
|
||||
console.log('searchQuery', searchQuery)
|
||||
|
||||
return parse(searchQuery)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue