find-hashtags
Advanced tools
Comparing version 1.0.0 to 1.0.1
var XRegExp = require('xregexp').XRegExp; | ||
var hashtagExp = XRegExp('\\S*#[\\p{L}\\d]+', 'i'); | ||
var hashtagExp = XRegExp('#[\\p{L}\\d]+', 'i'); | ||
@@ -4,0 +4,0 @@ function FindHashtags() { |
{ | ||
"name": "find-hashtags", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Extracts the hashtags from a string", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,1 +52,15 @@ var test = require('tape'); | ||
}); | ||
test('hashtag with no space after preceding word', function (t) { | ||
var content = 'Example content like#This should correctly handle hashtags.'; | ||
t.deepEqual(hashtags(content), ['this']); | ||
t.end(); | ||
}); | ||
test('two hashtags with no space between', function (t) { | ||
var content = 'Example content#like#This should correctly handle hashtags.'; | ||
t.deepEqual(hashtags(content), ['like', 'this']); | ||
t.end(); | ||
}) |
6160
104