diff options
Diffstat (limited to 'src/Text')
| -rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 9 | ||||
| -rw-r--r-- | src/Text/Pandoc/Writers/Roff.hs | 8 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 794c5518a..fb05df1f7 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -131,14 +131,12 @@ blockToMan opts (Header level _ inlines) = do return $ nowrap $ literal heading <> contents blockToMan opts (CodeBlock _ str) = return $ literal ".IP" $$ - literal ".nf" $$ - literal "\\f[C]" $$ + literal ".EX" $$ ((case T.uncons str of Just ('.',_) -> literal "\\&" _ -> mempty) <> literal (escString opts str)) $$ - literal "\\f[R]" $$ - literal ".fi" + literal ".EE" blockToMan opts (BlockQuote blocks) = do contents <- blockListToMan opts blocks return $ literal ".RS" $$ contents $$ literal ".RE" @@ -291,8 +289,7 @@ inlineToMan opts (Quoted DoubleQuote lst) = do inlineToMan opts (Cite _ lst) = inlineListToMan opts lst inlineToMan opts (Code _ str) = - -- note that the V font is specially defined in the default man template - withFontFeature 'V' (return (literal $ escString opts str)) + withFontFeature 'C' (return (literal $ escString opts str)) inlineToMan opts (Str str@(T.uncons -> Just ('.',_))) = return $ afterBreak "\\&" <> literal (escString opts str) inlineToMan opts (Str str) = return $ literal $ escString opts str diff --git a/src/Text/Pandoc/Writers/Roff.hs b/src/Text/Pandoc/Writers/Roff.hs index d5602ebfb..7214e32f0 100644 --- a/src/Text/Pandoc/Writers/Roff.hs +++ b/src/Text/Pandoc/Writers/Roff.hs @@ -112,9 +112,11 @@ fontChange = do fromMaybe False (Map.lookup 'B' features)] ++ ['I' | fromMaybe False $ Map.lookup 'I' features] return $ - if null filling - then text "\\f[R]" - else text $ "\\f[" ++ filling ++ "]" + case filling of + [] -> text "\\f[R]" + -- see #9020. C is not a font, use CR. + ['C'] -> text "\\f[CR]" + _ -> text $ "\\f[" ++ filling ++ "]" withFontFeature :: (HasChars a, IsString a, PandocMonad m) => Char -> MS m (Doc a) -> MS m (Doc a) |
