summaryrefslogtreecommitdiffstats
path: root/model
diff options
context:
space:
mode:
authorJoramWilander <jwawilander@gmail.com>2015-06-19 08:25:47 -0400
committerJoramWilander <jwawilander@gmail.com>2015-06-19 08:25:47 -0400
commit5bacc2b2910197306ba6116b7266555794afe89c (patch)
tree65749595952fb365e31878571e4cde10b4656b61 /model
parent3849ea485a9df0e14b8282177b547659180e34f0 (diff)
downloadchat-5bacc2b2910197306ba6116b7266555794afe89c.tar.gz
chat-5bacc2b2910197306ba6116b7266555794afe89c.tar.bz2
chat-5bacc2b2910197306ba6116b7266555794afe89c.zip
improved split function
Diffstat (limited to 'model')
-rw-r--r--model/utils.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/model/utils.go b/model/utils.go
index 2541247de..9f1788699 100644
--- a/model/utils.go
+++ b/model/utils.go
@@ -319,3 +319,5 @@ func ClearMentionTags(post string) string {
var UrlRegex = regexp.MustCompile(`^((?:[a-z]+:\/\/)?(?:(?:[a-z0-9\-]+\.)+(?:[a-z]{2}|aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|local|internal))(:[0-9]{1,5})?(?:\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(?:\?[a-z0-9+_~\-\.%=&amp;]*)?)?(?:#[a-zA-Z0-9!$&'()*+.=-_~:@/?]*)?)(?:\s+|$)$`)
var PartialUrlRegex = regexp.MustCompile(`/api/v1/files/(get|get_image)/([A-Za-z0-9]{26})/([A-Za-z0-9]{26})/(([A-Za-z0-9]+/)?.+\.[A-Za-z0-9]{3,})`)
+
+var SplitRunes = map[rune]bool{',': true, ' ': true, '.': true, '!': true, '?': true, ':': true, ';': true, '\n': true, '<': true, '>': true, '(': true, ')': true, '{': true, '}': true, '[': true, ']': true, '+': true}