diff options
author | Albert Krewinkel <albert@zeitkraut.de> | 2020-06-28 19:35:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-28 10:35:50 -0700 |
commit | 19175af811b7a95c4e732466cddac04947c01917 (patch) | |
tree | 57b2502a1d710484ffd9936eae450875d57033d2 /src | |
parent | d2d5eb8a993553eb5d1b9b9ca7863638864dde7e (diff) | |
download | pandoc-19175af811b7a95c4e732466cddac04947c01917.tar.gz |
JATS reader: parse abstract element into metadata field of same name (#6482)
Closes: #6480
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/JATS.hs | 9 |
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 |