From 5ae82374ffb23728ded5e79f64006a71d9a07caf Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Thu, 26 Oct 2023 11:44:54 +0200 Subject: [PATCH] fixed url encoded image links not being converted correctly closes #4 --- src/main.ts | 2 +- test-vault/Cool Test Note.md | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 01bd6fc..62a4281 100644 --- a/src/main.ts +++ b/src/main.ts @@ -242,7 +242,7 @@ export default class JustSharePleasePlugin extends Plugin { let match: RegExpExecArray; while ((match = attachments.exec(text)) != null) { let alt = match[1] ?? ""; - let url = match[2] ?? match[3]; + let url = decodeURI(match[2] ?? match[3]); if (url.startsWith("http")) continue; try { diff --git a/test-vault/Cool Test Note.md b/test-vault/Cool Test Note.md index 86cff99..1cab006 100644 --- a/test-vault/Cool Test Note.md +++ b/test-vault/Cool Test Note.md @@ -61,6 +61,13 @@ wikilink image! ![[Pasted image 20230816130420.png]] +image but with spaces in the name! + +![](Pasted%20image%2020230816130420.png) + +online image! +![](https://ellpeck.de/res/me.jpeg) + nice [^1]: Normal footnote!