aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/JATS.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
index 9cdbf1611..37e0d13bc 100644
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -35,6 +35,7 @@ import Text.Pandoc.XML.Light
import qualified Data.Set as S (fromList, member)
import Data.Set ((\\))
import Text.Pandoc.Sources (ToSources(..), sourcesToText)
+import qualified Data.Foldable as DF
type JATS m = StateT JATSState m
@@ -226,9 +227,19 @@ parseBlock (Elem e) =
mapM getInlines
(filterChildren (const True) t)
Nothing -> return mempty
- img <- getGraphic (Just (capt, attrValue "id" e)) g
- return $ para img
+
+ let figAttributes = DF.toList $
+ ("alt", ) . strContent <$>
+ filterChild (named "alt-text") e
+
+ return $ simpleFigureWith
+ (attrValue "id" e, [], figAttributes)
+ capt
+ (attrValue "href" g)
+ (attrValue "title" g)
+
_ -> divWith (attrValue "id" e, ["fig"], []) <$> getBlocks e
+
parseTable = do
let isCaption x = named "title" x || named "caption" x
capt <- case filterChild isCaption e of