aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/JATS.hs
diff options
context:
space:
mode:
authorAlbert Krewinkel <albert@zeitkraut.de>2020-06-28 19:35:50 +0200
committerGitHub <noreply@github.com>2020-06-28 10:35:50 -0700
commit19175af811b7a95c4e732466cddac04947c01917 (patch)
tree57b2502a1d710484ffd9936eae450875d57033d2 /src/Text/Pandoc/Readers/JATS.hs
parentd2d5eb8a993553eb5d1b9b9ca7863638864dde7e (diff)
downloadpandoc-19175af811b7a95c4e732466cddac04947c01917.tar.gz
JATS reader: parse abstract element into metadata field of same name (#6482)
Closes: #6480
Diffstat (limited to 'src/Text/Pandoc/Readers/JATS.hs')
-rw-r--r--src/Text/Pandoc/Readers/JATS.hs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
index d7f87f695..d3d742de3 100644
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -317,6 +317,7 @@ parseMetadata e = do
getTitle e
getAuthors e
getAffiliations e
+ getAbstract e
return mempty
getTitle :: PandocMonad m => Element -> JATS m ()
@@ -348,6 +349,14 @@ getAffiliations x = do
affs <- mapM getInlines $ filterChildren (named "aff") x
unless (null affs) $ addMeta "institute" affs
+getAbstract :: PandocMonad m => Element -> JATS m ()
+getAbstract e =
+ case filterElement (named "abstract") e of
+ Just s -> do
+ blks <- getBlocks s
+ addMeta "abstract" blks
+ Nothing -> pure ()
+
getContrib :: PandocMonad m => Element -> JATS m Inlines
getContrib x = do
given <- maybe (return mempty) getInlines