add mentions and tags
This commit is contained in:
parent
c780197d35
commit
f7c948b4ac
2 changed files with 18 additions and 0 deletions
14
lib.js
14
lib.js
|
@ -22,6 +22,20 @@ function splitUp(content) {
|
|||
out[i] = ['link',res];
|
||||
continue;
|
||||
}
|
||||
let urlThing = "";
|
||||
if (res[0] == '@' || res[0] == '#') {
|
||||
let type = res[0] == '@' ? '/users/' : '/walls/get/hub/';
|
||||
let type2 = res[0] == '@' ? '' : '/0';
|
||||
urlThing = new URL(type + res.slice(1) + type2, 'https://tbg.dervland.net/').pathname
|
||||
}
|
||||
if (res[0] == '@') {
|
||||
out[i] = ['curl',res, urlThing];
|
||||
continue;
|
||||
}
|
||||
if (res[0] == '#') {
|
||||
out[i] = ['curl',res, urlThing];
|
||||
continue;
|
||||
}
|
||||
out[i] = [res];
|
||||
}
|
||||
return out;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue