https://bugs.documentfoundation.org/show_bug.cgi?id=149013
--- Comment #16 from Christophe Strobbe <[email protected]> --- I'll skip the discussion on how the long description should be exposed in LibreOffice, since this issue is about how it should be exported to HTML. (In reply to Michael Weghorn from comment #15) > (In reply to sdc.blanco from comment #10) > (...) > For ODF itself, the corresponding attribute is "svg:desc", described as: > "The <svg:desc> element specifies a prose description of a graphic object > that may be used to support accessibility. See appendix D." > ( > https://docs.oasis-open.org/office/OpenDocument/v1.3/os/part3-schema/ > OpenDocument-v1.3-os-part3-schema.html#__RefHeading__1415840_253892949 ) That is correct. > @Christophe: > Comment 11 and comment 12 are very helpful, thanks! > But to be honest, after reading those, I don't know what would be a proper > way of handling "Description" on HTML export. > Any suggestion? I would suggest the following: Export the contents of the ODF <svg:desc> element to a <p> element below the <p> element containing the <img> element. Give that <p> element an ID attribute. Give the <img> element an aria-describedby attribute that points to the paragraph's ID attribute. Example (simplified): <p><img src="..." alt="..." aria-describedby="longdescription1" name="..." /></p> <p id="longdescription1">[Contents of ODF's svg:desc element inserted here]</p> (Adding a longdesc to the img element is optional, due to poor support. The syntax of the attribute would then be longdesc="#longdescription1", since it expect a URL or a fragement identifier, whereas the aria-describedby expects an ID.) Note that when LibreOffice starts exporting image captions correctly (in LibreOffice 7.1.4.2, the caption text gets embedded in the exported image), the p element with the description would be below the caption (assuming the caption is below instead of above the image). > (In reply to Christophe Strobbe from comment #11) > > The longdesc attribute has a long history of being rather poorly supported > > by screen readers and has been removed from HTML5, so that is not a good > > solution. > > That seems to rule out "longdesc", which otherwise looks like it would be > quite equivalent from a semantic perspective. > > (In reply to Christophe Strobbe from comment #11) > > A caption is no replacement for a text alternative or a long description, > > since the caption is also presented to sighted users and can be used in LO > > to generated a "Table of Figures" for the entire document. > > As I understand it, "the caption is also presented to sighted users" also > applies for the "figcaption" in HTML, so exporting the description to that > would generate visible output in the HTML page. My general expectation would > be that the description would generally not be visible in an exported > document by default, since it isn't visible in Writer either. > So, with my limited background knowledge, that doesn't really sound like a > perfect match either. > > Reading https://www.w3.org/WAI/tutorials/images/complex/ more or less gives > me the impression that using an image caption instead of the "Description" > would maybe be a better way to create accessible documents that are meant to > be exported to HTML in the first place... > Mapping ODF's <svg:desc> to HTML5's figcaption would cause a mismatch. LibreOffice's "save as HTML" would need to handle image captions correctly before we can consider ways of referencing a long description from an HTML figcaption element. ODF's captions are currently not exported to HTML as text but embedded in the image to which they belong: see Bug 142356. (LibreOffice's "Export as XHTML" function exports to "XHTML 1.1 plus MathML 2.0", which has no figure or figcaption elements, since these elements were first introduced in HTML 5. XHTML 1.1 has been superseded since 2018: https://www.w3.org/TR/xhtml11/ .) -- You are receiving this mail because: You are the assignee for the bug.
