jekyll-cloudinary icon indicating copy to clipboard operation
jekyll-cloudinary copied to clipboard

alt and caption management: special chars

Open borisschapira opened this issue 7 years ago • 2 comments

Alternative text and caption may contain special characters: quotes, HTML code (for caption). I've found a workaround to escape quotes and apostrophe:

{% capture img_alt %}L'intérieur de l'église de Château-L'Évèque{% endcapture %}
{% capture img_caption %}Jacques Bodin, "Église de Château-L'Évèque", cc-by-2.0{% endcapture %}
{% cloudinary {{ img_path }} alt="{{ img_alt | escape }}" caption="{{ img_caption | markdownify }}" %}

But I can't figure out how to make the tag work when the caption contains HTML code.

borisschapira avatar Dec 14 '17 08:12 borisschapira

The caption is already parsed for Markdown: https://github.com/nhoizey/jekyll-cloudinary/blob/master/lib/jekyll/cloudinary.rb#L162-L165

What kind of HTML would you like to add, that you can't write as Markdown?

nhoizey avatar Dec 15 '17 08:12 nhoizey

Tried this as caption :

A "test" at [Google](https://www.google.com "Google Search Engine")

borisschapira avatar Dec 18 '17 16:12 borisschapira