diff options
| author | John MacFarlane <jgm@berkeley.edu> | 2022-12-28 17:16:30 -0800 |
|---|---|---|
| committer | John MacFarlane <jgm@berkeley.edu> | 2022-12-28 17:16:30 -0800 |
| commit | ce7d1d1c2029d7a248c1a84958d464dd45f332a2 (patch) | |
| tree | 60038da09005f02a3dd4dc74d36faded729f4c49 /src | |
| parent | 6c96340bf63df36c91d11d405af96da8b736eb56 (diff) | |
Man writer: use UTF-8 by default for non-ascii characters.
Only use groff escapes if `--ascii` has been specified on the
command line (`writerPreferAscii`).
Closes #8507.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/Writers/Man.hs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Man.hs b/src/Text/Pandoc/Writers/Man.hs index 4e1651e53..859378dce 100644 --- a/src/Text/Pandoc/Writers/Man.hs +++ b/src/Text/Pandoc/Writers/Man.hs @@ -83,7 +83,9 @@ pandocToMan opts (Pandoc meta blocks) = do Just tpl -> renderTemplate tpl context escString :: WriterOptions -> Text -> Text -escString _ = escapeString AsciiOnly -- for better portability +escString opts = escapeString (if writerPreferAscii opts + then AsciiOnly + else AllowUTF8) -- | Return man representation of notes. notesToMan :: PandocMonad m => WriterOptions -> [[Block]] -> StateT WriterState m (Doc Text) |
