BetterGifAltText: Decode url encoded jazz
This commit is contained in:
parent
3c2bbb698a
commit
9aaa47ea4e
|
@ -27,7 +27,11 @@ export default definePlugin({
|
||||||
altify(props: any) {
|
altify(props: any) {
|
||||||
if (props.alt !== "GIF") return;
|
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
|
let name = url
|
||||||
.slice(url.lastIndexOf("/") + 1)
|
.slice(url.lastIndexOf("/") + 1)
|
||||||
.replace(/\d/g, "") // strip numbers
|
.replace(/\d/g, "") // strip numbers
|
||||||
|
|
Loading…
Reference in a new issue