Native unused attachment deletion ignores links inside blockquotes

Steps to reproduce

  • Enable the core setting to delete unused attachments once a note is deleted
  • Create a first note and embed an image inside a blockquote, like:
  • Create a second note and embed the identical image as a normal markdown link
  • Delete the second note

Did you follow the troubleshooting guide? [Y/N]

Yes.

Expected result

Obsidian must recognize the active image link inside the blockquote of the first note and preserve the file without any warnings.

Actual result

Obsidian fails to parse the markdown inside the quote correctly and treats the image as completely unused. It then prompts the user to delete the file.

Environment

Obsidian version 1.12.4
Windows


Additional information

Normal text works perfectly
Blockquotes break the native detection

(post deleted by author)

Steps to reproduced are not displayed correctly, and there are some new insights:

Enable the core setting to delete unused attachments once a note is deleted

Create a first note and embed an image inside a blockquote, like:
> ![](.attachments/image-13.png)

Create a second note and embed the identical image as a normal markdown link

![](.attachments/image-13.png)

Delete the second note

Note:
The image only gets marked for deletion if there are six or more whitespaces between > and ! in the blockquote

If you don’t have the extra whitespace, It isn’t deleted because it is linked in another file.

If you do have the whitespace, I don’t think it is a valid Markdown syntax.

By coincidence, Live Preview shows it. But if you go to Reading Mode to see how it is actually rendering, the link is pre-formatted like code.

You can also verify this by looking in the Outgoing Links pain. If you have that indentation, the link doesn’t even appear.

I can’t say if this Live Preview display issue is a bug or not. (Bugs are not my department anyway. I’m just a mod.) There are always a few discrepancies between Live Preview and Reading Mode. I think this is incorrect syntax, and you’ll need to fix the indentation in your blockquote(s).

But I’d personally say there isn’t a bug in the attachment deletion itself. It’s only deleting the attachment if it is detected as not being in any other notes other than the one being deleted.

Oh I see. Thank you so much for this input. I’m still learning, sorry. Never looked at the page in reading mode. But you are completely correct. My way to indent text / images is not the correct way to do and results in an incorrect syntax. I completely relied on the live view so far, where everything looked fine. But again, you are completely right and I should look for other possibilities to indent text/images, maybe by using a snipped or something else.
Thanks again

1 Like