Skip to content

Commit afff071

Browse files
committed
markdown linkuser 小修复
1 parent 7d027ea commit afff071

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

common/at.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ var _ = require('lodash');
2121
*/
2222
var fetchUsers = function (text) {
2323
var ignore_regexs = [
24-
/```.+?```/, // 去除单行的 ```
24+
/```.+?```/g, // 去除单行的 ```
2525
/^```[\s\S]+?^```/gm, // ``` 里面的是 pre 标签内容
2626
/`[\s\S]+?`/g, // 同一行中,`some code` 中内容也不该被解析
2727
/^ .*/gm, // 4个空格也是 pre 标签,在这里 . 不会匹配换行
@@ -33,6 +33,7 @@ var fetchUsers = function (text) {
3333
text = text.replace(ignore_regex, '');
3434
});
3535

36+
3637
var results = text.match(/@[a-z0-9\-_]+\b/igm);
3738
var names = [];
3839
if (results) {

controllers/site.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ var renderHelper = require('../common/render_helper');
1919

2020
// 主页的缓存工作。主页是需要主动缓存的
2121
function indexCache() {
22+
if (config.debug) {
23+
return;
24+
}
2225
var limit = config.list_topic_count;
2326
// 为所有版块(tab)做缓存
2427
[['', '全部']].concat(config.tabs).forEach(function (pair) {

test/common/at.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ describe('test/common/at.test.js', function () {
4444
@alsotang3
4545
```
4646
47+
```js
48+
@flow
49+
```
50+
4751
```@alsotang4```
4852
4953
@
@@ -87,6 +91,10 @@ [email protected] [@alsotang](/user/alsotang)
8791
@alsotang3
8892
```
8993
94+
```js
95+
@flow
96+
```
97+
9098
```@alsotang4```
9199
92100
@

0 commit comments

Comments
 (0)