therainisme / vscode-clear-markdown-unused-images

This extension moves unused images in Markdown files to the 'unused-images' folder.
MIT License
3 stars 0 forks source link

deletes too many images #1

Closed kuntergunt closed 3 weeks ago

kuntergunt commented 4 weeks ago

I gave this extension a try on my Azure DevOps wiki. It found the images and moved them to the unused.images folder. But it moved more than 431 images out of 478. That seemed to be way too many for me. I checked and found a lot of pages with missing images. So somehow the algorithm does not detect every usage of an image. At least not for the Azure DevOps type of Markdown pages.

therainisme commented 4 weeks ago

Can you provide more information about the markdown of the removed images? For example, how to reference the image in markdown, and the location of the image.

kuntergunt commented 4 weeks ago

Here is an example, one of the pages that lost it's image: The link in the source code looks like this: cert_exp.png

The directory hierarchy for those two files in VSCode looks like this: .attachments\cert_exp-49141bcf-f2db-404c-b2a8-4fc7ede8b106.png Customer-Documentation\SAP-AddOn\Programs\Certificate-Expiration-Alert.md

therainisme commented 4 weeks ago

What kind of image link is in your Customer-Documentation\SAP-AddOn\Programs\Certificate-Expiration-Alert.md file?

![image](.attachment\cert_exp-49141bcf-f2db-404c-b2a8-4fc7ede8b106.png)
![image](../../../attachments/cert_exp-49141bcf-f2db-404c-b2a8-4fc7ede8b106.png)

The former seems to be a link format specific to the Azure DevOps wiki. I can't reproduce your bug in vscode.

kuntergunt commented 3 weeks ago

Sorry, seems like this part of the above message got modified. I try to make it readable, this is the part within the parenthesis: /.attachments/cert_exp-49141bcf-f2db-404c-b2a8-4fc7ede8b106.png So the path starts from root, but it's the root of the project, not of the file system. Seems weird, but all the tools I've used (including VSCode) seem to be able to understand this correctly,

therainisme commented 3 weeks ago

Thank you for reporting this issue! It has been fixed in #2.