fedimbed: trim urls
This commit is contained in:
parent
370f6a882a
commit
1d541bf122
1 changed files with 2 additions and 1 deletions
|
@ -493,7 +493,8 @@ events.add("messageCreate", "fedimbed", async function (msg) {
|
||||||
|
|
||||||
if (URLS_REGEX.test(msg.content)) {
|
if (URLS_REGEX.test(msg.content)) {
|
||||||
const urls = msg.content.match(URLS_REGEX);
|
const urls = msg.content.match(URLS_REGEX);
|
||||||
for (const url of urls) {
|
for (let url of urls) {
|
||||||
|
url = url.trim();
|
||||||
for (const service of Object.keys(PATH_REGEX)) {
|
for (const service of Object.keys(PATH_REGEX)) {
|
||||||
const regex = PATH_REGEX[service];
|
const regex = PATH_REGEX[service];
|
||||||
const urlObj = new URL(url);
|
const urlObj = new URL(url);
|
||||||
|
|
Loading…
Reference in a new issue