Changed hashtag regex to only accept hashtags that begin with a letter

This commit is contained in:
hmhealey
2015-09-22 14:28:43 -04:00
parent 1709532ae6
commit d025da5da9

View File

@@ -247,7 +247,7 @@ function autolinkHashtags(text, tokens) {
return prefix + alias;
}
return output.replace(/(^|\W)(#[a-zA-Z0-9.\-_]+)\b/g, replaceHashtagWithToken);
return output.replace(/(^|\W)(#[a-zA-Z][a-zA-Z0-9.\-_]*)\b/g, replaceHashtagWithToken);
}
function highlightSearchTerm(text, tokens, searchTerm) {