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

Title attribute is not used as the alt value on the <img> tag (Ruby) #382

Closed
Curtisjk opened this issue Aug 30, 2022 · 6 comments · Fixed by #385
Closed

Title attribute is not used as the alt value on the <img> tag (Ruby) #382

Curtisjk opened this issue Aug 30, 2022 · 6 comments · Fixed by #385
Labels

Comments

@Curtisjk
Copy link

Curtisjk commented Aug 30, 2022

I am looking to set alt text for accessibility reasons on generated diagrams. We originally put a human-readable description in the target, but this gets put into the filename and nginx generally doesn't like spaces in URIs.

I can see in the code there is provision to set alt text using attr.title but I am not sure if this is supported fully? I attempted the following:

[plantuml,target-name,svg,title="Title Alt Text"]
....
Bob -> Alice : hello
....

But this still resulted in the following HTML:

<div class="content">
<img src="images/target-name-648[...].svg" alt="target-name">
</div>
<div class="title">Figure 1. Title Alt Text</div>

Any guidance here would be greatly appreciated :)

@ggrossetie
Copy link
Member

Hey, are you using the Ruby or JavaScript library?

@ggrossetie
Copy link
Member

Using the browser extension, it produces:

<div class="imageblock kroki">
<div class="content">
<img src="https://kroki.io/plantuml/svg/eNpzyk9S0LVTcMzJTE5VsFLISM3JyQcAPHcGKw==" alt="Title Alt Text">
</div>
<div class="title">Figure 1. Title Alt Text</div>
</div>

@Curtisjk
Copy link
Author

We are using the version provided by the docker-asciidoctor container - which I believe is the ruby version?

@ggrossetie ggrossetie added 💎 Ruby 🐞 bug Something isn't working labels Aug 30, 2022
@ggrossetie ggrossetie changed the title How to set alt text? Title attribute is not used as the alt value on the <img> tag (Ruby) Aug 30, 2022
@ggrossetie
Copy link
Member

And we should probably add some documentation about this logic 😉

@Curtisjk
Copy link
Author

Thanks @Mogztter - I will work on the PR later this week.

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

Successfully merging a pull request may close this issue.

2 participants