Permalink
Browse files

Added a regex for checking whether a string constitutes a single vali…

…d hashtag
  • Loading branch information...
1 parent 9399d73 commit e1e35adfbc27d81fae94594b6a8949907f31246d Mikael Roos committed Aug 16, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 flowdock-text.js
View
@@ -161,6 +161,7 @@ if (typeof FlowdockText === "undefined" || FlowdockText === null) {
FlowdockText.regexen.hashtagAlphaNumeric = regexSupplant(/[a-z0-9_\-#{latinAccentChars}#{nonLatinHashtagChars}]/i);
FlowdockText.regexen.endHashtagMatch = /^(?:[##]|:\/\/)/;
FlowdockText.regexen.hashtagBoundary = regexSupplant(/(?:^|$|[^&\/a-z0-9_#{latinAccentChars}#{nonLatinHashtagChars}])/);
+ FlowdockText.regexen.singleValidHashTag = regexSupplant(/^#{hashtagAlphaNumeric}+$/i);
// FlowdockText change: allow all-numeric hashtags
FlowdockText.regexen.autoLinkHashtags = regexSupplant(/(#{hashtagBoundary})(#|#)(#{hashtagAlphaNumeric}+)/gi);
FlowdockText.regexen.autoLinkMentions = regexSupplant(/(#{hashtagBoundary})(@)(#{usernameAlphaNumeric}*#{usernameAlphaNumericEnd}+)/gi);

0 comments on commit e1e35ad

Please sign in to comment.