diff --git a/lib.js b/lib.js index 0942a19..6c0ca01 100644 --- a/lib.js +++ b/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; diff --git a/views/comment.ejs b/views/comment.ejs index bbb7c32..a5ecbbf 100644 --- a/views/comment.ejs +++ b/views/comment.ejs @@ -23,6 +23,8 @@ <% } else if (contentN[0] == 'link') { %> <%= contentN[1] %> + <% } else if (contentN[0] == 'curl') { %> + <%= contentN[1] %> <% } else if (contentN[0].replaceAll(' ','').length > 0) { %> <%= contentN[0] %> <% } } %> @@ -30,6 +32,8 @@ <% if (!isNaN(date * 1)) { %>