Skip to content

Commit d048e4e

Browse files
committed
little fix
1 parent 78990e4 commit d048e4e

2 files changed

Lines changed: 22 additions & 22 deletions

File tree

‎common/at.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ var fetchUsers = function (text) {
2424
/```[\s\S]+?```/g, // ``` 里面的是 pre 标签内容
2525
/`[\s\S]+?`/g, // 同一行中,`some code` 中内容也不该被解析
2626
/^ .*/gm, // 4个空格也是 pre 标签,在这里 . 不会匹配换行
27-
/@[^\s]*?\..+?/g, // somebody@gmail.com 会被去除
27+
/@[^\s]*?\..+?\b/g, // somebody@gmail.com 会被去除
2828
];
2929

3030
ignore_regexs.forEach(function(ignore_regex) {

‎test/common/at.test.js‎

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe('test/common/at.test.js', function () {
3434
Text 中文@begin_with_no_spaces
3535
@end_with_no_space@begin_with_no_spaces
3636

37-
jysperm@gmail.com
37+
jysperm@gmail.com @alsotang
3838

3939
@
4040
@@
@@ -52,36 +52,36 @@ describe('test/common/at.test.js', function () {
5252
```
5353
*/});
5454

55-
var matched_users = ['A-aZ-z0-9_', 'begin_with_spaces', 'multi_in_oneline', 'around_text', 'end_with_no_space', 'begin_with_no_spaces', 'end_with_no_space', 'begin_with_no_spaces'];
55+
var matched_users = ['A-aZ-z0-9_', 'begin_with_spaces', 'multi_in_oneline', 'around_text', 'end_with_no_space', 'begin_with_no_spaces', 'end_with_no_space', 'begin_with_no_spaces', 'alsotang'];
5656

5757
var linkedText = multiline.stripIndent(function(){/*
58-
[@A-aZ-z0-9_](/user/A-aZ-z0-9_)
59-
@中文
60-
[@begin_with_spaces](/user/begin_with_spaces) [@multi_in_oneline](/user/multi_in_oneline)
61-
Text More Text [@around_text](/user/around_text) ![Pic](/public/images/cnode_icon_32.png)
62-
[@end_with_no_space](/user/end_with_no_space)中文
63-
Text 中文@begin_with_no_spaces
64-
[@end_with_no_space](/user/end_with_no_space)@begin_with_no_spaces
58+
[@A-aZ-z0-9_](/user/A-aZ-z0-9_)
59+
@中文
60+
[@begin_with_spaces](/user/begin_with_spaces) [@multi_in_oneline](/user/multi_in_oneline)
61+
Text More Text [@around_text](/user/around_text) ![Pic](/public/images/cnode_icon_32.png)
62+
[@end_with_no_space](/user/end_with_no_space)中文
63+
Text 中文[@begin_with_no_spaces](/user/begin_with_no_spaces)
64+
[@end_with_no_space](/user/end_with_no_space)[@begin_with_no_spaces](/user/begin_with_no_spaces)
6565

66-
jysperm@gmail.com
66+
jysperm@gmail.com [@alsotang](/user/alsotang)
6767

68-
@
69-
@@
68+
@
69+
@@
7070

71-
`@code_begin_with_no_space`
72-
code: `@in_code`
71+
`@code_begin_with_no_space`
72+
code: `@in_code`
7373

74-
@in_pre
74+
@in_pre
7575

76-
``` @in_oneline_pre ```
76+
``` @in_oneline_pre ```
7777

78-
```
79-
Some Code
80-
Code @in_multi_line_pre
81-
```
78+
```
79+
Some Code
80+
Code @in_multi_line_pre
81+
```
8282
*/});
8383

84-
describe.only('#fetchUsers()', function () {
84+
describe('#fetchUsers()', function () {
8585
var fetchUsers = at.fetchUsers;
8686
it('should found 6 users', function () {
8787
var users = fetchUsers(text);

0 commit comments

Comments
 (0)