-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
alt-text and caption content missing from graphics in JATS #9130
Comments
Thanks. There aren't places here to put both an alt-text and a caption. (But the JATS documentation says to put the caption element in a figure, not under graphic, except in cases where a figure contains multiple subfigures; a caption under a figure is handled elsewhere in the code.) I'd suggest we look first in caption to populate the "image description," and then in alt-text if there is nothing in caption. |
I don't think that's what the JATS spec is saying. It says to put the I really think that if the original JATS document has a valid structure, like a I also don't think Bottomline issue is, pandoc assumes Therefore, I suggest we split this problem. We can easily take care of the treatment for alt-text now by simply fetching it from a child element instead of an attribute. But no replacement with caption or viceversa. Then, we can separately discuss how to better address the remaining block elements of What do yo think? |
Pandoc has to fit everything into its own structure, the Pandoc AST. This doesn't correspond exactly to the structure JATS represents, so there might not be an exact fit. JATS has an inline level element I'm okay with your suggestion of grabbing the alt-text from a child element, and waiting til later to decide what to do with caption. |
Problem
In the function getGraphic, the JATS reader fetches information for the identifier, title, and alt-text* parameters contents of a figure, as follows:
pandoc/src/Text/Pandoc/Readers/JATS.hs
Lines 143 to 152 in ba07ec0
However, the attribute
@alt-text
does not exist in the<graphic>
element. Only a child element<alt-text>
exists, as per the JATS specs: https://jats.nlm.nih.gov/archiving/tag-library/1.3/element/graphic.htmlAs a result, no alt-text is ever captured for
<graphic>
elements, even if one is given. In addition, since no provision is made for any<caption>
child, this content gets skipped.The result from the input JATS fragment below
is
Note how neither
<alt-text>
nor<caption>
content has been captured.Pandoc version?
All versions.
*For some reason the variables that represent alt-text are called capt and capt', suggesting caption content, which might have confused things in the original code.
The text was updated successfully, but these errors were encountered: