Trim end of url

This commit is contained in:
Kieran 2023-07-21 17:29:42 +01:00
parent 34f5ac291e
commit 660944fd29
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -9,7 +9,7 @@ import { MediaElement } from "Element/MediaElement";
async function fetchUrlPreviewInfo(url: string) {
const api = new SnortApi();
try {
return await api.linkPreview(url);
return await api.linkPreview(url.endsWith(")") ? url.slice(0, -1) : url);
} catch (e) {
console.warn(`Failed to load link preview`, url);
}