Is it possible to set the alt attribute when using an image tag?

pt
ptmkenny
Posts: 37
Joined: Fri May 04, 2018 8:43 am
Platform: Mac + Windows

Wed May 16, 2018 6:27 am Post

In Scrivener 3, according to 15.6.5 in the manual:

The basic syntax for the image tag is:
<$img:IMAGE_NAME;w=WIDTH;h=HEIGHT>


Is there any way to set the alt attribute when using this feature? If not, how might I link to an image file (instead of embedding it) and set the alt attribute?

User avatar
KB
Site Admin
Posts: 20229
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Wed May 16, 2018 11:31 am Post

I'm afraid there is no way of setting the alt attribute for images at all, given that it's not a feature supported in images in the text system. (It's currently only possible when using MultiMarkdown syntax for writing.)
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
nontroppo
Posts: 1049
Joined: Mon Mar 05, 2007 5:22 pm
Platform: Mac
Location: Airstrip One

Wed May 16, 2018 11:50 am Post

In MMD and Pandoc markdown at least the syntax is as follows:

![alt text](linked_image.png "title text")

If a figure is on its own line, it becomes a fully marked up <figure> with <figcaption> like so:

Code: Select all

❯ pandoc -t html
Some text. 

![My Caption](image.png "More text")   

More text.

<p>Some text.</p>
<figure>
<img src="image.png" title="More text" alt="My Caption" /><figcaption>My Caption</figcaption>
</figure>
<p>More text.</p>


https://pandoc.org/MANUAL.html#images

pt
ptmkenny
Posts: 37
Joined: Fri May 04, 2018 8:43 am
Platform: Mac + Windows

Wed May 16, 2018 4:23 pm Post

Thanks to both of you! I see there's no way to do it with tags but there is a workaround via MultiMarkdown.