diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-03-08 19:06:32 +0100 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-03-08 19:06:32 +0100 |
commit | fd35661646b87c4960f6c610de06c891c78e9aab (patch) | |
tree | d2c9206b186b534c497f38f27af4c9fb04e89b86 /src/Text | |
parent | c91f168fc93f22b8c281fb2933052ff6da63d47b (diff) | |
download | pandoc-fd35661646b87c4960f6c610de06c891c78e9aab.tar.gz |
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.
Diffstat (limited to 'src/Text')
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 5 |
1 files changed, 4 insertions, 1 deletions
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 $ |