aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2018-10-22 23:56:02 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2018-10-22 23:56:02 -0700
commitbda1c0da81ac5f251ca7958fb0c20b4ea39eea70 (patch)
treebfea7b33ef4ac43f18960404a0c29b661ab65185 /src/Text/Pandoc
parent261cbad0ef2f42735c3914c6c448f5f21331de14 (diff)
downloadpandoc-bda1c0da81ac5f251ca7958fb0c20b4ea39eea70.tar.gz
Man reader: Handle optional argument in ME, UE macros.
Closes #4995.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Man.hs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/Man.hs b/src/Text/Pandoc/Readers/Man.hs
index 00a2618ff..cd17e96f3 100644
--- a/src/Text/Pandoc/Readers/Man.hs
+++ b/src/Text/Pandoc/Readers/Man.hs
@@ -765,20 +765,26 @@ parseDefinitionList = definitionList <$> many1 definitionListItem
parseLink :: PandocMonad m => [Arg] -> ManParser m Inlines
parseLink args = do
contents <- mconcat <$> many lineInl
- mmacro "UE"
+ MMacro _ endargs _ <- mmacro "UE"
let url = case args of
[] -> ""
(x:_) -> linePartsToString x
- return $ link url "" contents
+ return $ link url "" contents <>
+ case endargs of
+ [] -> mempty
+ (x:_) -> linePartsToInlines x
parseEmailLink :: PandocMonad m => [Arg] -> ManParser m Inlines
parseEmailLink args = do
contents <- mconcat <$> many lineInl
- mmacro "ME"
+ MMacro _ endargs _ <- mmacro "ME"
let url = case args of
[] -> ""
(x:_) -> "mailto:" ++ linePartsToString x
- return $ link url "" contents
+ return $ link url "" contents <>
+ case endargs of
+ [] -> mempty
+ (x:_) -> linePartsToInlines x
skipUnkownMacro :: PandocMonad m => ManParser m Blocks
skipUnkownMacro = do