@@ -163,7 +163,7 @@ parseBlock (CRef x) = return $ plain $ str $ T.toUpper x
163163parseBlock (Elem e) = do
164164 sectionLevel <- gets jatsSectionLevel
165165 let parseBlockWithHeader = wrapWithHeader (sectionLevel+ 1 ) (getBlocks e)
166-
166+
167167 case qName (elName e) of
168168 " book" -> parseBook
169169 " book-part-wrapper" -> parseBook
@@ -234,7 +234,7 @@ parseBlock (Elem e) = do
234234 " toc-div" -> parseBlockWithHeader
235235 " toc-entry" -> parseBlockWithHeader
236236 " toc-group" -> parseBlockWithHeader
237- " toc-title-group" -> return mempty -- handled by toc
237+ " toc-title-group" -> return mempty -- handled by toc
238238 " legend" -> parseBlockWithHeader
239239 " dedication" -> parseBlockWithHeader
240240 " foreword" -> parseBlockWithHeader
@@ -385,17 +385,17 @@ parseBlock (Elem e) = do
385385 wrapWithHeader n mBlocks = do
386386 isBook <- gets jatsBook
387387 let n' = case (filterChild (named " title" ) e >>= maybeAttrValue " display-as" ) of
388- Just t -> read $ T. unpack t
389- Nothing -> if isBook || n == 0 then n + 1 else n
388+ Just t -> read $ T. unpack t
389+ Nothing -> if isBook || n == 0 then n + 1 else n
390390 headerText <- case filterChild (named " title" ) e of
391391 Just t -> case maybeAttrValue " supress" t of
392- Just s -> if s == " no"
393- then getInlines t
392+ Just s -> if s == " no"
393+ then getInlines t
394394 else return mempty
395395 Nothing -> getInlines t
396396 Nothing -> do
397397 let name = qName (elName e)
398- if (name == " dedication" || name == " foreword" || name == " preface" )
398+ if (name == " dedication" || name == " foreword" || name == " preface" )
399399 then return $ str $ T. toTitle name
400400 else case filterChild (named " index-title-group" ) e >>= filterChild (named " title" ) of
401401 Just i -> getInlines i
@@ -407,10 +407,10 @@ parseBlock (Elem e) = do
407407 blocks <- mBlocks
408408 let ident = attrValue " id" e
409409 modify $ \ st -> st{ jatsSectionLevel = oldN }
410- return $ (if headerText == mempty
411- then mempty
410+ return $ (if headerText == mempty
411+ then mempty
412412 else headerWith (ident,[] ,[] ) n' headerText) <> blocks
413- parseBook = do
413+ parseBook = do
414414 modify $ \ st -> st{ jatsBook = True }
415415 getBlocks e
416416
@@ -421,7 +421,7 @@ getInlines e' = trimInlines . mconcat <$>
421421parseMetadata :: PandocMonad m => Element -> JATS m Blocks
422422parseMetadata e = do
423423 isBook <- gets jatsBook
424- if isBook then getBookTitle e else getArticleTitle e
424+ if isBook then getBookTitle e else getArticleTitle e
425425 if isBook then getBookAuthors e else getArticleAuthors e
426426 getAffiliations e
427427 getAbstract e
0 commit comments