alangrainger / obsidian-image-captions

Add captions to images with inline Markdown and link support. The caption format is compatible with the CommonMark spec and other Markdown applications.
GNU General Public License v3.0
101 stars 7 forks source link

MCL gallery cards (efemkay) compatibility #32

Open chrsdk opened 2 weeks ago

chrsdk commented 2 weeks ago

I've recently started using Image Captions plugin to add captions to newly added images to my vault.

I also use the excellent MCL gallery cards css snippet, which allows adding options for image placement, sizing, etc.

A lot of my images have these options added, but they don't have a caption and I don't wish to add one. For these images the format options are now taken as captions unless I add one.

20241112_150732.jpg

20241112_150652.jpg

Would it be possible for the plugin to ignore these formating options when there's no caption?

chrsdk commented 6 days ago

I use the proposed RE from the plugin documentation:

^([^|]+)

This should remove everything after the first pipe, by selecting the filename.

However, it seems that the removal doesn't work if the caption is left empty.