git.iko.soy/typeable/pandoc
on master help sign in
Man reader: allow .nf to be implicitly closed by eof.
commit1a7b9382db3c948ccae0b8b081a0e960a6daf14f authorJohn MacFarlane <jgm@berkeley.edu> dateSat 27 Oct 2018, 08:51 (8 years ago) parentdae03de
1 file changed+5−3
src/Text/Pandoc/Readers/Man.hs+5−3
src/Text/Pandoc/Readers/Man.hs+5−3
@@ -36,7 +36,7 @@ module Text.Pandoc.Readers.Man (readMan) where
3636import Prelude
3737import Data.Char (toLower)
3838import Data.Default (Default)
39−import Control.Monad (liftM, mzero, guard)
39+import Control.Monad (liftM, mzero, guard, void)
4040import Control.Monad.Trans (lift)
4141import Control.Monad.Except (throwError)
4242import Text.Pandoc.Class (PandocMonad(..), report)
@@ -345,8 +345,10 @@ bareIP = msatisfy isBareIP where
345345 isBareIP (MMacro "IP" [] _) = True
346346 isBareIP _ = False
347347
348−endmacro :: PandocMonad m => String -> ManParser m RoffToken
349−endmacro name = mmacro name <|> lookAhead newBlockMacro
348+endmacro :: PandocMonad m => String -> ManParser m ()
349+endmacro name = void (mmacro name)
350+ <|> lookAhead (void newBlockMacro)
351+ <|> lookAhead eof
350352 where
351353 newBlockMacro = msatisfy isNewBlockMacro
352354 isNewBlockMacro (MMacro "SH" _ _) = True