Closed FellowEsin closed 1 month ago
Addendum: Apparently, someone has suggested before that a caption perimeter was added to avoid conflicts with this very snippet. I guess this could be a solution?
Addendum No. 2: Oddly, the center alignment doesn't work when this plugin is enabled. But when I disable the plugin, it works. So there's this incompatibility as well.
That's really an issue with that theme. In the Commonmark spec, the image description is the part of markdown between the square brackets on an image link.
![Image description](file.jpg)
So that theme putting image location commands in that place doesn't seem like a great idea.
However I can see that there is the probability of this theme and other themes/plugins in the future adding all sorts of data into that same image description field.
What I'll do is add a setting where you can add a custom regex to filter the final caption. That should cover all possible use cases into the future, regardless of what plugins or image caption formats people are using.
Looking forward for it! Also I'd really like a manual on how to use the custom regex once the feature comes out. Thank you!
Oh awesome! I completly forgot about this until I got the emails for activity on my original issue. Looming forward to the release!
@TDSrock @FellowEsin This has been added in 1.1.2
I have added a setting where you can add a custom regex to determine exactly what to parse for the caption, depending on your own preference and vault setup.
In the case of using ITS, the regex should be:
^([^|]+)
YEAAAAH LET'S GOOO! Though how do we use the regex? Can I have an example?
I literally put the exact example you need in my comment above :grimacing:
So it's just surrounding the |? I see. Sorry.
Just copy and paste exactly this into the settings box, and the caption will ignore anything following a pipe |
character (which is what ITS uses):
^([^|]+)
Stupid question but, which settings box exactly?
Did you update the plugin?
Yes I have! You were talking about the plugin configs! Sorry.
Thank you soooo much!
No problem, glad it's all working! :)
Sorry to say this, but there is some sort of new problem: It causes problems with links.
And when you want to actually use | in your caption, it's another problem.
Is there a workaround to this or anything?
Firstly, that would never work. You can't specify a link like that as the first set of ]]
would close the outer link.
You need to follow the documentation and use <<
>>
for wikilinks:
To use Wikilinks, you'll need to swap your square brackets [[]] for angle brackets <<>>:
![[image.jpg|This is a caption with <<a Wikilink>>]]
Secondly, the reason for using the regex is so that you can customise it for your exact use case, since I couldn't possibly cover all plugins/themes/usecases myself.
Just change the regex to allow an escaped pipe:
^((\\\||[^|])+)
For any other cases you come across, please research on Google how to write the correct regex expression. You don't need to post any other questions here - you can customise the regex yourself to handle any custom cases in your own unique vault setup.
So cool! Thank you so much!
@FellowEsin Please update to 1.1.3 - I had forgotten to include the theme's CSS file in the 1.1.2 release :grimacing:
What do you mean by the theme's CSS file?
This file. Just update to 1.1.3 and it will be fixed.
Ohhh okay! Updated! Thanks a lot!
Hey, I'm wondering, how can I align the image and not set a caption?
Hello!
I'd like to use this plugin with the ITS image adjustment snippet, but there are some issues. The thing is, when I set the image parameters like this (caption + adjustment), for example
It does align the image, and shows the caption, but like this.
I want to display "Amogus" only, not "Amogus | right".
Any solutions or suggestions? Thank you.