From fd35661646b87c4960f6c610de06c891c78e9aab Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Wed, 8 Mar 2017 19:06:32 +0100 Subject: Remove space at beginning/end of RST code span. Otherwise we get invalid RST. There seems to be no way to escape the space. Closes #3496. --- src/Text/Pandoc/Writers/RST.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/Text') diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index f1de2ab0e..2657afa2a 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -459,7 +459,10 @@ inlineToRST (Quoted DoubleQuote lst) = do else return $ "“" <> contents <> "”" inlineToRST (Cite _ lst) = inlineListToRST lst -inlineToRST (Code _ str) = return $ "``" <> text str <> "``" +inlineToRST (Code _ str) = + -- we trim the string because the delimiters must adjoin a + -- non-space character; see #3496 + return $ "``" <> text (trim str) <> "``" inlineToRST (Str str) = do opts <- gets stOptions return $ text $ -- cgit v1.2.3