diff options
author | Tor Andersson <tor@ccxvii.net> | 2022-04-06 23:03:25 +0000 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2022-04-15 14:34:17 +0200 |
commit | dadc4ca510d5e45e270faa04775f377d8ff40412 (patch) | |
tree | 56400c1ffd28294a1bfdc6a6e45844d07cd210ae /server.js | |
parent | 9b5f4346d31e82dc02763126d5c249cbfebb1e55 (diff) | |
download | server-dadc4ca510d5e45e270faa04775f377d8ff40412.tar.gz |
Linkify all links in a post.
Diffstat (limited to 'server.js')
-rw-r--r-- | server.js | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -742,7 +742,7 @@ function show_forum_page(req, res, page) { function linkify_post(text) { text = text.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">"); - text = text.replace(/https?:\/\/\S+/, (match) => { + text = text.replace(/https?:\/\/\S+/g, (match) => { if (match.endsWith(".jpg") || match.endsWith(".png") || match.endsWith(".svg")) return `<a href="${match}"><img src="${match}"></a>`; return `<a href="${match}">${match}</a>`; |