On 7/14/2025 12:44 AM, Matthias Weber wrote:
Hello again,

When providing an alt-text for images like so (which works for PDFs):

\setupexternalfigures[location=default]

\setupbackend[export=yes,xhtml=yes]

\setupinteraction
   [state=start]
                
\starttext

\startchapter[title=Example]
\startsection[title={Section}]

\placefigure
   {}
   {\externalfigure[hacker.jpg][
   label={Look, a $e^{\pi i}+1=0$ hacker!}]
}

\stopchapter

\stoptext

the figure becomes in the HTML export

<div class="float figure method-here" id="aut-3">
       <div class="floatcontent"><div class="image label-Look, a $e^{\\\\pi i}+1=0$ hacker!" 
id="export-example-image-1" image="export-example-image-1"><!--empty--></div></div>
       <div class="floatcaption"><div class="floatlabel figure">Figure </div><div 
class="floatnumber figure">1.1</div></div>
   </div>

How do I turn this into an ALT text in the HTML? Or how do I have to provide 
the Alt text correctly? And what do I do about Alt texts that contain math?
The \\\\pi looks a little strange…

labels actually end up as class entry which is what labels were for: identifier

so we have to reconsider using label and find another key instead, like 'comment' or 'description' or so, something that is not yet used as we might need it in more places .. maybe comment is best left for something not interpred so 'description' could work ... given wolfgangs blessing

adding it to the export is a few lines (escaping is a different discussion)

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
       tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to