git.iko.soy/typeable/pandoc
on master help sign in
Removed trailing whitespace.
c5a0c7aJohn MacFarlane
src/Text/Pandoc/Readers/DocBook.hs+15−15
@@ -555,23 +555,23 @@ attrValue attr elt =
555named :: String -> Element -> Bool
555named :: String -> Element -> Bool
556named s e = qName (elName e) == s
556named s e = qName (elName e) == s
557
557
558−--
558+--
559
559
560acceptingMetadata :: DB a -> DB a
560acceptingMetadata :: DB a -> DB a
561acceptingMetadata p = do
561acceptingMetadata p = do
562 modify (\s -> s { dbAcceptsMeta = True } )
562 modify (\s -> s { dbAcceptsMeta = True } )
563 res <- p
563 res <- p
564 modify (\s -> s { dbAcceptsMeta = False })
564 modify (\s -> s { dbAcceptsMeta = False })
565− return res
565+ return res
566
566
567−checkInMeta :: Monoid a => DB () -> DB a
567+checkInMeta :: Monoid a => DB () -> DB a
568checkInMeta p = do
568checkInMeta p = do
569− accepts <- dbAcceptsMeta <$> get
569+ accepts <- dbAcceptsMeta <$> get
570− when accepts p
570+ when accepts p
571 return mempty
571 return mempty
572−
572+
573−
573+
574−
574+
575addMeta :: ToMetaValue a => String -> a -> DB ()
575addMeta :: ToMetaValue a => String -> a -> DB ()
576addMeta field val = modify (setMeta field val)
576addMeta field val = modify (setMeta field val)
577
577
@@ -650,9 +650,9 @@ parseBlock (Elem e) =
650 "attribution" -> return mempty
650 "attribution" -> return mempty
651 "titleabbrev" -> return mempty
651 "titleabbrev" -> return mempty
652 "authorinitials" -> return mempty
652 "authorinitials" -> return mempty
653− "title" -> checkInMeta getTitle
653+ "title" -> checkInMeta getTitle
654− "author" -> checkInMeta getAuthor
654+ "author" -> checkInMeta getAuthor
655− "authorgroup" -> checkInMeta getAuthorGroup
655+ "authorgroup" -> checkInMeta getAuthorGroup
656 "releaseinfo" -> checkInMeta (getInlines e >>= addMeta "release")
656 "releaseinfo" -> checkInMeta (getInlines e >>= addMeta "release")
657 "date" -> checkInMeta getDate
657 "date" -> checkInMeta getDate
658 "bibliography" -> sect 0
658 "bibliography" -> sect 0
@@ -717,7 +717,7 @@ parseBlock (Elem e) =
717 "figure" -> getFigure e
717 "figure" -> getFigure e
718 "mediaobject" -> para <$> getImage e
718 "mediaobject" -> para <$> getImage e
719 "caption" -> return mempty
719 "caption" -> return mempty
720− "info" -> metaBlock
720+ "info" -> metaBlock
721 "articleinfo" -> metaBlock
721 "articleinfo" -> metaBlock
722 "sectioninfo" -> return mempty -- keywords & other metadata
722 "sectioninfo" -> return mempty -- keywords & other metadata
723 "refsectioninfo" -> return mempty -- keywords & other metadata
723 "refsectioninfo" -> return mempty -- keywords & other metadata
@@ -788,12 +788,12 @@ parseBlock (Elem e) =
788 getInlines s
788 getInlines s
789 Nothing -> return mempty
789 Nothing -> return mempty
790 addMeta "title" (tit <> subtit)
790 addMeta "title" (tit <> subtit)
791−
791+
792 getAuthor = (:[]) <$> getInlines e >>= addMeta "author"
792 getAuthor = (:[]) <$> getInlines e >>= addMeta "author"
793 getAuthorGroup = do
793 getAuthorGroup = do
794 let terms = filterChildren (named "author") e
794 let terms = filterChildren (named "author") e
795− mapM getInlines terms >>= addMeta "authors"
795+ mapM getInlines terms >>= addMeta "authors"
796− getDate = getInlines e >>= addMeta "date"
796+ getDate = getInlines e >>= addMeta "date"
797 parseTable = do
797 parseTable = do
798 let isCaption x = named "title" x || named "caption" x
798 let isCaption x = named "title" x || named "caption" x
799 caption <- case filterChild isCaption e of
799 caption <- case filterChild isCaption e of