Fixed: extensions can be searched with ".foo" in addition to "ext:foo"
This commit is contained in:
@@ -46,6 +46,15 @@ export class Query {
|
||||
}
|
||||
this.query = parsed
|
||||
|
||||
// Extract keywords starting with a dot...
|
||||
const ext = this.query.text
|
||||
.filter(o => o.startsWith('.'))
|
||||
.map(o => o.slice(1))
|
||||
// add them to the ext field...
|
||||
this.query.ext = [...new Set([...ext, ...(this.query.ext ?? [])])]
|
||||
// and remove them from the text field
|
||||
this.query.text = this.query.text.filter(o => !o.startsWith('.'))
|
||||
|
||||
// Get strings in quotes, and remove the quotes
|
||||
this.#inQuotes =
|
||||
text.match(/"([^"]+)"/g)?.map(o => o.replace(/"/g, '')) ?? []
|
||||
|
||||
Reference in New Issue
Block a user