tags: sort_uniq, use "," separator, trim and lowercase
This commit is contained in:
parent
260651b4a4
commit
78ecbc9e4b
1 changed files with 7 additions and 1 deletions
|
|
@ -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 =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue