diff options
author | John MacFarlane <jgm@berkeley.edu> | 2016-12-05 00:50:17 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2016-12-05 00:50:17 +0100 |
commit | 41627ed62c57d9e51a89352bc843d8265f1bc83f (patch) | |
tree | dff99ae2007e3835087d6a8ad3819a38d65ddb7e /src/Text | |
parent | 33b4bc837196582956d8bd5538b6676be6a0f8e9 (diff) | |
download | pandoc-41627ed62c57d9e51a89352bc843d8265f1bc83f.tar.gz |
Man writer: Ensure that periods are escaped at beginning of line.
Closes #3270.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 3dd89f17e..98b08b08b 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -300,10 +300,6 @@ blockListToMan opts blocks = -- | Convert list of Pandoc inline elements to man. inlineListToMan :: WriterOptions -> [Inline] -> State WriterState Doc --- if list starts with ., insert a zero-width character \& so it --- won't be interpreted as markup if it falls at the beginning of a line. -inlineListToMan opts lst@(Str ('.':_) : _) = mapM (inlineToMan opts) lst >>= - (return . (text "\\&" <>) . hcat) inlineListToMan opts lst = mapM (inlineToMan opts) lst >>= (return . hcat) -- | Convert Pandoc inline element to man. @@ -335,6 +331,8 @@ inlineToMan opts (Cite _ lst) = inlineListToMan opts lst inlineToMan _ (Code _ str) = return $ text $ "\\f[C]" ++ escapeCode str ++ "\\f[]" +inlineToMan _ (Str str@('.':_)) = + return $ afterBreak "\\&" <> text (escapeString str) inlineToMan _ (Str str) = return $ text $ escapeString str inlineToMan opts (Math InlineMath str) = inlineListToMan opts $ texMathToInlines InlineMath str |