LiaScript icon indicating copy to clipboard operation
LiaScript copied to clipboard

alt text for an image is interpreted as a caption

Open damienbelveze opened this issue 2 years ago • 3 comments

Hello,

While the given syntax in Liascript manual is clear to make a caption/title for an image as well as an alt-text alt-text the alt-text is still interpreted as an alt-text (appears when we hover on the image) and also as a caption. Whereas github pages make the difference between the two : alt-text appears when we hover on the image and caption is just below it.

Regards,

damienbelveze avatar Jan 18 '24 10:01 damienbelveze

Hi @damienbelveze , what browser are you using or can you make a screenshot? I tried it with Firefox and Chrome and it shows the same behavior, except that the title is printed out below in LiaScript in any case.

example-document

Do you mean, when there is no title, then the alt-text is used?

Regards,

André

andre-dietrich avatar Jan 18 '24 11:01 andre-dietrich

Hi @andre-dietrich ,

Thank you for your answer. My Markdown document ( [ https://damienbelveze.github.io/Mastodon_SN/main_course.md | https://damienbelveze.github.io/Mastodon_SN/main_course.md ] ) includes the code below:

Mastodon meme

I would like to have Mastodon meme as a caption and " Mastodon Mamouth stands in the middle of a quiet jungle with a cactus in its paws and says This is fine. This picture refers to a meme with a dog sitting in the middle of a burning house surrended by flames and yet having coffee and saying the same sentence" as an alt-text (hover) for people who cannot see the image.

but instead of that, I get the following with Firefox 118.0 : [ https://liascript.github.io/course/?https://raw.githubusercontent.com/damienbelveze/Mastodon_SN/main/main_course.md#1 | https://liascript.github.io/course/?https://raw.githubusercontent.com/damienbelveze/Mastodon_SN/main/main_course.md#1 ]

(screenshot attached to this mail) It's ok for the alt-text, but not for the caption which should be only "Mastodon meme"]

Regards,

Damien Belvèze

De: "andre-dietrich" @.> À: "LiaScript/LiaScript" @.> Cc: "Damien Belveze" @.>, "Mention" @.> Envoyé: Jeudi 18 Janvier 2024 12:30:00 Objet: Re: [LiaScript/LiaScript] alt text for an image is interpreted as a caption (Issue #157)

Hi [ https://github.com/damienbelveze | @damienbelveze ] , what browser are you using or can you make a screenshot? I tried it with Firefox and Chrome and it shows the same behavior, except that the title is printed out below in LiaScript in any case.

[ https://liascript.github.io/LiveEditor/?/show/code/H4sIAAAAAAAAA82QsU4DMRBEe3/FYhoobAeFCuUoUoDSISEqRLHc+ZwltteyN4Tw9XBIEV0qBJRvNMW8OYVVwuCbUiePGMWIf5Ons7VIaVfObUtkHOyONpT8QGi5BjdRmcj1nBLn5uZu3rsli1DvYyRTKiV89RXtSwmg7w4Iz3u4xzxUhu82UAOEERNvGxSkLJQD8Aiy9nBxOZs1CyuZWpl3QPkrfxhHeie4xRh93U/pTeTqc+/1uTrqYu0fDDLGKLWgFKDVvtM/ea+GT9VOH3w1CEn03S87Xh/Rs/afbPwAlh5unewCAAA= | example-document ]

Do you mean, when there is no title, then the alt-text is used?

Regards,

André

— Reply to this email directly, [ https://github.com/LiaScript/LiaScript/issues/157#issuecomment-1898303452 | view it on GitHub ] , or [ https://github.com/notifications/unsubscribe-auth/AJEMQGREGYWFOQFLJ65SS63YPEBTRAVCNFSM6AAAAABCAB4IOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQOJYGMYDGNBVGI | unsubscribe ] . You are receiving this because you were mentioned. Message ID: <LiaScript/LiaScript/issues/157/1898303452 @ github . com>

-- Damien Belvèze Conservateur chargé de la formation des usagers Equipe ARDEL aide aux chercheurs pour la gestion des données de recherche

= = = = = = = = = = Université de Rennes Service Commun de Documentation 33 (0)2 23 23 32 34 33 (0)6 69 61 10 52

damienbelveze avatar Jan 18 '24 12:01 damienbelveze

Hi Damien,

the alt and title/caption attributes are simply passed to the image. These attributes can be overwritten, by attaching an HTML-comment, where you could also apply styling or add classes. The example would be the simplest solution, or plain old HTML, but I guess that is not what you want :see_no_evil: ... Swapping alt and title is at the moment not possible. We simply tried to expose the title as a caption, but in the future an additional caption configuration might be good feature...

![Mastodon Mamouth](https://damienbelveze.github.io/Mastodon_SN/images/mastodon.jpg "Mastodon Mamouth")<!-- 
title="Mastodon Mamouth stands in the middle of a quiet jungle with a cactus in its paws and says This is fine. This picture refers to a meme with a dog sitting in the middle of a burning house surrounded by flames and yet having coffee and saying the same sentence" 
alt="Mastodon Mamouth V2"
-->

---- as HTML

<figure class="lia-figure">
<div class="lia-figure__media" data-media-type="image">
<img 
    alt="Mastodon Mamouth"
    title="Mastodon Mamouth stands in the middle of a quiet jungle with a cactus in its paws and says This is fine. This picture refers to a meme with a dog sitting in the middle of a burning house surrended by flames and yet having coffee and saying the same sentence"
    src="https://damienbelveze.github.io/Mastodon_SN/images/mastodon.jpg" loading="lazy">
</div>
<figcaption class="lia-figure__caption">
Mastodon Mamouth
</figcaption>
</figure>

andre-dietrich avatar Jan 19 '24 22:01 andre-dietrich