tags: sort_uniq, use "," separator, trim and lowercase

This commit is contained in:
Swrup 2022-02-27 18:43:43 +01:00
parent 84dd1c4397
commit 1f54bfe9be

View file

@ -367,7 +367,13 @@ let build_reply ~comment ?image ~tags ?parent_id nick =
| None -> None | None -> None
| Some (image_info, _image_content) -> Some image_info | Some (image_info, _image_content) -> Some image_info
in in
let tag_list = Str.split (Str.regexp " +") tags in let tag_list =
List.map String.lowercase_ascii
@@ List.sort_uniq String.compare
@@ List.filter (fun s -> not (String.equal "" s))
@@ List.map String.trim
@@ Str.split (Str.regexp ",+") tags
in
let date = Unix.time () in let date = Unix.time () in
let comment, citations = parse_comment comment in let comment, citations = parse_comment comment in
let reply = let reply =