pretext icon indicating copy to clipboard operation
pretext copied to clipboard

images in slides don't support alt text

Open kcrisman opened this issue 2 years ago • 3 comments

I don't think an issue has been opened for this yet.

The normal html conversion supports image alt text via description tags. However, this is overridden in the revealjs template here, as far as I can tell from both the code and my own experimentation.

A stupidly naive fix I am currently using is this. (See also #1888.) Probably the code for images in slides should reuse at least some of the html code, but this is more complex due to the various inclusion options.

 <xsl:template match="image">
   <img>
+    <xsl:attribute name="style">
+    <xsl:text>width: </xsl:text>
+    <xsl:value-of select="@width" />
+    </xsl:attribute>
+    <xsl:attribute name="alt">
+      <xsl:apply-templates select="description" />
+    </xsl:attribute>
     <xsl:attribute name="src">
         <xsl:value-of select="@source" />
     </xsl:attribute>

kcrisman avatar Jan 02 '23 20:01 kcrisman

@sean-fitzpatrick can you check, once you're done getting images to do "the right thing", whether this would now be fixed?

kcrisman avatar Jul 22 '24 22:07 kcrisman

This would be handled by the xsl.

I've only touched the pretext Python script and the sample slideshow.

Rob has been doing upgrades to the xsl and I don't want to conflict with the work he's doing.

sean-fitzpatrick avatar Jul 22 '24 23:07 sean-fitzpatrick

This would be handled by the xsl.

Correct. Oh, I thought you had worked on that as well.

kcrisman avatar Jul 23 '24 00:07 kcrisman