From 9719a31c79844bfc4f39a791fcc687c70794898e Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Mon, 11 Sep 2017 09:55:29 -0400 Subject: [PATCH] Match less punctuation in hashtags (closes #4303) --- modules/ui/commit.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 9582a8386..75248ea8f 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -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 }