Capture tag if URL added before tag submission, allow for tags to be comma separated.

This commit is contained in:
Justin Hawkins 2022-06-09 19:51:21 +09:30
parent a2a1f9c06d
commit 2055bba5f0
2 changed files with 5 additions and 2 deletions

View File

@ -3,7 +3,7 @@
<div class="small-9 medium-10 large-5 cell"
hx-post="/tags"
hx-target="#label-widget"
hx-trigger="change">
hx-trigger="change queue:first">
<label for="tag-entry"
class="">Tags</label>

View File

@ -402,7 +402,10 @@ func cleanupTags(tags []string) []string {
keys := make(map[string]struct{})
for _, k := range tags {
if k != "" && k != "|" {
keys[strings.ToLower(k)] = struct{}{}
for _, subKey := range strings.Split(k, ",") {
subKey := strings.Trim(subKey, " ")
keys[strings.ToLower(subKey)] = struct{}{}
}
}
}
out := []string{}