add mentions and tags

This commit is contained in:
biglyderv 2025-03-04 00:37:47 -05:00
parent c780197d35
commit f7c948b4ac
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
2 changed files with 18 additions and 0 deletions

14
lib.js
View file

@ -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;