Fix #4752: Category metatags show up as errors in tag edit box.

Fix category prefix metatags not working in autocomplete. Now typing
e.g. `copy:t` will show tags starting with 't' in autocomplete.

Also fix it so that tags beginning with a '(' work in autocomplete.
Typing e.g. `-(tou` will show `touhou` in autocomplete.

This also fixes it so that when you type a negated tag in autocomplete,
e.g. `-touhou`, it sends `touhou` in the autocomplete API call, rather
than `-touhou`. This makes caching more effective since negated tags
will be cached the same as non-negated tags.
This commit is contained in:
evazion
2022-04-29 21:47:41 -05:00
parent bbe748bd2b
commit 031ab1e833
2 changed files with 5 additions and 4 deletions

View File

@@ -24,7 +24,7 @@ class AutocompleteService
order: PostQueryBuilder::ORDER_METATAGS
}
TAG_PREFIXES = ["-", "~"] + TagCategory.mapping.keys.map { |prefix| prefix + ":" }
TAG_PREFIXES = TagCategory.mapping.keys.map { |prefix| prefix + ":" }
attr_reader :query, :type, :limit, :current_user