summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-09-17 22:51:10 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-09-17 22:51:10 +0900
commitf5a937c523b2165dedd1edd94267c3a0efb5a7a4 (patch)
tree396a84c7ea8f148fd49d13c91f4065d5efb9705f /test
parent8.45.1 (diff)
downloadmisskey-f5a937c523b2165dedd1edd94267c3a0efb5a7a4.tar.gz
misskey-f5a937c523b2165dedd1edd94267c3a0efb5a7a4.tar.bz2
misskey-f5a937c523b2165dedd1edd94267c3a0efb5a7a4.zip
Better hashtag parsing
Diffstat (limited to 'test')
-rw-r--r--test/mfm.ts13
1 files changed, 11 insertions, 2 deletions
diff --git a/test/mfm.ts b/test/mfm.ts
index 901ffb80e3..a015092f0c 100644
--- a/test/mfm.ts
+++ b/test/mfm.ts
@@ -71,11 +71,20 @@ describe('Text', () => {
});
it('hashtag', () => {
- const tokens = analyze('Strawberry Pasta #alice');
+ const tokens1 = analyze('Strawberry Pasta #alice');
assert.deepEqual([
{ type: 'text', content: 'Strawberry Pasta ' },
{ type: 'hashtag', content: '#alice', hashtag: 'alice' }
- ], tokens);
+ ], tokens1);
+
+ const tokens2 = analyze('Foo #bar, baz #piyo.');
+ assert.deepEqual([
+ { type: 'text', content: 'Foo ' },
+ { type: 'hashtag', content: '#bar', hashtag: 'bar' },
+ { type: 'text', content: ', baz ' },
+ { type: 'hashtag', content: '#piyo', hashtag: 'piyo' },
+ { type: 'text', content: '.' }
+ ], tokens2);
});
it('url', () => {