-
-
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
Correct location of alt-text content #9134
Conversation
@@ -138,18 +138,16 @@ trimNl = T.dropAround (== '\n') | |||
|
|||
-- function that is used by both graphic (in parseBlock) | |||
-- and inline-graphic (in parseInline) | |||
getGraphic :: PandocMonad m | |||
=> Maybe (Inlines, Text) -> Element -> JATS m Inlines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noticed this function was only ever called with Nothing
as first argument, which means it does not need it. Got rid of this argument and all corresponding logic.
let altText = case filterElement (named "alt-text") e of | ||
Just alt -> textContent alt | ||
Nothing -> mempty | ||
(ident, title, altText') = (atVal "id", atVal "title", text altText) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
third argument is actually capturing alt-text, not caption, renamed as such
Just (capt', i) -> (i, "fig:" <> atVal "title", capt') | ||
Nothing -> (atVal "id", atVal "title", | ||
text (atVal "alt-text")) | ||
let altText = case filterElement (named "alt-text") e of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is where we fetch content from a child, rather than an argument
great, thanks! |
Fix JATS reader erroneously attempting to fetch alt-text content from non-existent @alt-text attribute, to optional child element