From 3305a018bc38a435a7bd006f9447d97ee3ea6868 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 30 Oct 2018 15:54:29 -0700 Subject: Roff reader: properly handle unknown backslash escapes. They are treated as regular characters, according to groff 7. Cloess #5034. --- src/Text/Pandoc/Readers/Roff.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Roff.hs b/src/Text/Pandoc/Readers/Roff.hs index a540cc39d..9e3315cb3 100644 --- a/src/Text/Pandoc/Readers/Roff.hs +++ b/src/Text/Pandoc/Readers/Roff.hs @@ -284,7 +284,10 @@ escapeNormal = do CopyMode -> char '\\' NormalMode -> return '\\' return [RoffStr "\\"] - _ -> fail $ "Unknown escape character \\" ++ [c] + _ -> return [RoffStr [c]] + -- man 7 groff: "If a backslash is followed by a character that + -- does not constitute a defined escape sequence, the backslash + -- is silently ignored and the character maps to itself." escIgnore :: PandocMonad m => Char -- cgit v1.2.3