aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-12-23 22:28:43 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2017-12-23 22:28:43 -0800
commitc7e5543c293f08059a953aed2ca2039a3b1dd092 (patch)
treea4d2c29cc3e549458634736d5d38b66bcddf5649 /src/Text/Pandoc/Readers
parent4612a9a8c11313104ef733442e403f607bbcfb7e (diff)
downloadpandoc-c7e5543c293f08059a953aed2ca2039a3b1dd092.tar.gz
JATS reader: handle author-notes.
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/JATS.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/JATS.hs b/src/Text/Pandoc/Readers/JATS.hs
index 77cd08cb3..9223db68c 100644
--- a/src/Text/Pandoc/Readers/JATS.hs
+++ b/src/Text/Pandoc/Readers/JATS.hs
@@ -308,8 +308,12 @@ getAuthors e = do
authors <- mapM getContrib $ filterElements
(\x -> named "contrib" x &&
attrValue "contrib-type" x == "author") e
- unless (null authors) $
- addMeta "author" authors
+ authorNotes <- mapM getInlines $ filterElements (named "author-notes") e
+ let authors' = case (reverse authors, authorNotes) of
+ ([], _) -> []
+ (_, []) -> authors
+ (a:as, ns) -> reverse as ++ [a <> mconcat ns]
+ unless (null authors) $ addMeta "author" authors'
getAffiliations :: PandocMonad m => Element -> JATS m ()
getAffiliations x = do
@@ -467,9 +471,6 @@ parseInline (Elem e) =
"uri" -> return $ link (strContent e) "" $ str $ strContent e
"fn" -> (note . mconcat) <$>
mapM parseBlock (elContent e)
- -- Note: this isn't a real docbook tag; it's what we convert
- -- <?asciidor-br?> to in handleInstructions, above. A kludge to
- -- work around xml-light's inability to parse an instruction.
_ -> innerInlines
where innerInlines = (trimInlines . mconcat) <$>
mapM parseInline (elContent e)