Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alt text for an image is interpreted as a caption #157

Open
damienbelveze opened this issue Jan 18, 2024 · 3 comments
Open

alt text for an image is interpreted as a caption #157

damienbelveze opened this issue Jan 18, 2024 · 3 comments

Comments

@damienbelveze
Copy link

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,

@andre-dietrich
Copy link
Member

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é

@damienbelveze
Copy link
Author

damienbelveze commented Jan 18, 2024 via email

@andre-dietrich
Copy link
Member

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 🙈 ... 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>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants