Skip to content

Commit eb60734

Browse files
author
robot
committed
fix: 标签支持链接
1 parent 2939c83 commit eb60734

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

static/solution/generate.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ const solutions = require("./solutions.json");
77

88
function toArray(sep = "-", txt) {
99
if (!txt) return txt;
10+
// 兼容形如 - [dfs](https://www.xxxxxx)
11+
12+
if (/\[(.+)\](.+)/.test(txt)) {
13+
try {
14+
txt = /\[(.+)\](.+)/.exec(txt)[1];
15+
} catch (err) {
16+
console.log(err);
17+
}
18+
}
19+
1020
return txt
1121
.split(sep)
1222
.slice(1)

0 commit comments

Comments
 (0)