implement link formatting
This commit is contained in:
parent
e7a41a520a
commit
711a799482
3 changed files with 24 additions and 9 deletions
15
lib.js
15
lib.js
|
@ -10,7 +10,20 @@ function apiStat(res, next, message, success = false, redirect = '/') {
|
|||
}
|
||||
|
||||
function splitUp(content) {
|
||||
let out = content.split('\n').map(x => x.split('::'));
|
||||
let out = content.split(/(\s)/g);
|
||||
|
||||
for (let i in out) {
|
||||
let res = out[i];
|
||||
if (res.startsWith('file::')) {
|
||||
out[i] = ['file', res.slice('file::'.length)];
|
||||
continue;
|
||||
}
|
||||
if (res.startsWith('https://')) {
|
||||
out[i] = ['link',res];
|
||||
continue;
|
||||
}
|
||||
out[i] = [res];
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue