BetterGifAltText: Decode url encoded jazz

This commit is contained in:
Vendicated 2022-09-29 23:45:15 +02:00
parent 3c2bbb698a
commit 9aaa47ea4e
No known key found for this signature in database
GPG key ID: EC781ADFB93EFFA3

View file

@ -27,7 +27,11 @@ export default definePlugin({
altify(props: any) {
if (props.alt !== "GIF") return;
const url: string = props.original || props.src;
let url: string = props.original || props.src;
try {
url = decodeURI(url);
} catch {}
let name = url
.slice(url.lastIndexOf("/") + 1)
.replace(/\d/g, "") // strip numbers