Add utility regexp split function for non-whitespace words

This commit is contained in:
BrokenEagle
2020-03-07 06:10:50 +00:00
parent d1aed303fd
commit 161e776cf7
4 changed files with 15 additions and 14 deletions

View File

@@ -550,8 +550,8 @@ Post.update_tag_count = function(event) {
let count = 0;
if (event) {
let tags = [...new Set($(event.target).val().match(/\S+/g))];
if (tags) {
let tags = Utility.regexp_split($(event.target).val());
if (tags.length) {
count = tags.length;
string = (count === 1) ? (count + " tag") : (count + " tags")
}