Skip to content

Commit

Permalink
Fix bug causing broken links to be unescaped.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextoumbourou committed Apr 11, 2023
1 parent fedd294 commit 114abb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ export default class BetterMarkdownLinksPlugin extends Plugin {
const newFileContent = fileContent.replace(
/\[(.*?)\]\((.*?)\)/g,
(_, linkText, linkUrl) => {
linkUrl = decodeURIComponent(linkUrl);
if (path.basename(linkUrl) === path.basename(oldPath)) {
const linkUrlDecoded = decodeURIComponent(linkUrl);
if (path.basename(linkUrlDecoded) === path.basename(oldPath)) {
const normedLink = this.normalizePathForLink(
file.path,
// @ts-ignore
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "obsidian-title-as-link-text",
"name": "Title As Link Text",
"version": "1.0.3",
"version": "1.0.4",
"minAppVersion": "0.15.0",
"description": "This plugin improves the behaviour of Markdown-style links in Obsidian.",
"author": "Lex Toumbourou",
Expand Down

0 comments on commit 114abb7

Please sign in to comment.