Match less punctuation in hashtags

(closes #4303)
This commit is contained in:
Bryan Housel
2017-09-11 09:55:29 -04:00
parent 0d35c5ed59
commit 9719a31c79
+2 -2
View File
@@ -283,7 +283,7 @@ export function uiCommit(context) {
// Extract hashtags from `comment`
function commentTags() {
return tags.comment.match(/#[^\s\#]+/g);
return tags.comment.match(/#[\w-]+/g);
}
// Extract and clean hashtags from `hashtags`
@@ -293,7 +293,7 @@ export function uiCommit(context) {
.split(/[,;\s]+/)
.map(function (s) {
if (s[0] !== '#') { s = '#' + s; } // prepend '#'
var matched = s.match(/#[^\s\#]+/g); // match valid hashtags
var matched = s.match(/#[\w-]+/g); // match valid hashtags
return matched && matched[0];
}).filter(Boolean); // exclude falsey
}