mirror of
https://github.com/cnodejs/nodeclub.git
synced 2025-12-08 19:55:55 +00:00
markdown linkuser 小修复
This commit is contained in:
parent
7d027ea264
commit
afff071e89
@ -21,7 +21,7 @@ var _ = require('lodash');
|
||||
*/
|
||||
var fetchUsers = function (text) {
|
||||
var ignore_regexs = [
|
||||
/```.+?```/, // 去除单行的 ```
|
||||
/```.+?```/g, // 去除单行的 ```
|
||||
/^```[\s\S]+?^```/gm, // ``` 里面的是 pre 标签内容
|
||||
/`[\s\S]+?`/g, // 同一行中,`some code` 中内容也不该被解析
|
||||
/^ .*/gm, // 4个空格也是 pre 标签,在这里 . 不会匹配换行
|
||||
@ -33,6 +33,7 @@ var fetchUsers = function (text) {
|
||||
text = text.replace(ignore_regex, '');
|
||||
});
|
||||
|
||||
|
||||
var results = text.match(/@[a-z0-9\-_]+\b/igm);
|
||||
var names = [];
|
||||
if (results) {
|
||||
|
||||
@ -19,6 +19,9 @@ var renderHelper = require('../common/render_helper');
|
||||
|
||||
// 主页的缓存工作。主页是需要主动缓存的
|
||||
function indexCache() {
|
||||
if (config.debug) {
|
||||
return;
|
||||
}
|
||||
var limit = config.list_topic_count;
|
||||
// 为所有版块(tab)做缓存
|
||||
[['', '全部']].concat(config.tabs).forEach(function (pair) {
|
||||
|
||||
@ -44,6 +44,10 @@ describe('test/common/at.test.js', function () {
|
||||
@alsotang3
|
||||
```
|
||||
|
||||
```js
|
||||
@flow
|
||||
```
|
||||
|
||||
```@alsotang4```
|
||||
|
||||
@
|
||||
@ -87,6 +91,10 @@ jysperm@gmail.com [@alsotang](/user/alsotang)
|
||||
@alsotang3
|
||||
```
|
||||
|
||||
```js
|
||||
@flow
|
||||
```
|
||||
|
||||
```@alsotang4```
|
||||
|
||||
@
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user