forked from Kieran/snort
Trim end of url
This commit is contained in:
parent
34f5ac291e
commit
660944fd29
@ -9,7 +9,7 @@ import { MediaElement } from "Element/MediaElement";
|
|||||||
async function fetchUrlPreviewInfo(url: string) {
|
async function fetchUrlPreviewInfo(url: string) {
|
||||||
const api = new SnortApi();
|
const api = new SnortApi();
|
||||||
try {
|
try {
|
||||||
return await api.linkPreview(url);
|
return await api.linkPreview(url.endsWith(")") ? url.slice(0, -1) : url);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(`Failed to load link preview`, url);
|
console.warn(`Failed to load link preview`, url);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user