Fix for Embedded Non-image Files Glitching the Card Header Display #79
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Well... I got bored/motivated today and managed to squash this bug. I tested what I believe are all of the cases for the
imagePrefix
(attachments folder) on my own machine:![[img.png]]
, located in<img-prefix-folder>/img.png
![[<img-prefix-folder>/img.png]]
, located in<img-prefix-folder>/img.png
![pointless-name](<img-prefix-folder>/big%20red%20firetruck.png)
, located in<img-prefix-folder>/big red firetruck.png
I haven't worked in Typescript or with the Obsidian API before, so I'd certainly give things a look to make sure I didn't screw up in any major ways. I also don't know whether this solution is portable to mobile os, since I'm not aware of the salient concerns.
As it is, I'm following what appears to be @xpgo's convention of not considering images that are not a) in the user's settings-specified attachments folder, or b) in the specified folder in the
ccard
code block asimagePrefix: 'attachments/'
, since that seems to avoid a large number of headaches.Anyway, I really appreciate your work putting this .plugin together, and hopefully this works out
Fixes #43 (and #37)