obsidian-folder-note-plugin icon indicating copy to clipboard operation
obsidian-folder-note-plugin copied to clipboard

[BUG] regex includes image resize modifiers

Open DanArcherOnline opened this issue 3 years ago • 1 comments

The Problem

The regex below includes image resize modifiers.

https://github.com/xpgo/obsidian-folder-note-plugin/blob/272bbdc9a674fd333e6a97b02611868797648585/src/folder-brief.ts#L160

I don't know the official name, but an image resize modifier is when you prefix |<new image width> to a markdown image link.

In my case, the I am using ![[Pasted image 20220602231944.png|300]] to make my image 300px wide. I often do this to stop the images from taking up huge amounts of space.

imageUrl is being set to my/assets/path/Pasted image 20220602231944.png|300, but this is not the correct path because it contains the image resize modifier. You can see the encoded characters after the .png in the screenshot below

image

Possible Solution

remove the image resize modifier text (\|\d+) before assigning to imageUrl

DanArcherOnline avatar Jul 17 '22 18:07 DanArcherOnline

i've got the same issue, i'm using cover hsmall as a resize modifier and the plugin is searching the filelisting forthe full img.png|cover hsmall rather than img.png: image

Proshyak avatar Oct 03 '22 11:10 Proshyak