From 9aaa47ea4e9ac068bf5fcbb997e31d722f43f1e5 Mon Sep 17 00:00:00 2001 From: Vendicated Date: Thu, 29 Sep 2022 23:45:15 +0200 Subject: [PATCH] BetterGifAltText: Decode url encoded jazz --- src/plugins/betterGifAltText.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/betterGifAltText.ts b/src/plugins/betterGifAltText.ts index 3e408202a..475404225 100644 --- a/src/plugins/betterGifAltText.ts +++ b/src/plugins/betterGifAltText.ts @@ -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