aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-07-12 13:53:10 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-07-12 13:53:10 -0700
commit37e68a818bd0adafa4b90048eab0efc94a4980c4 (patch)
treefb5e9f1917f9285c466c050bd2946c9418442629 /src
parentbf7c624c809fc3ee510f3d15b6e0aea5d8c262f7 (diff)
downloadpandoc-37e68a818bd0adafa4b90048eab0efc94a4980c4.tar.gz
RST reader: avoid extra newline in included code blocks.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index e558836a1..17defa422 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -484,7 +484,7 @@ includeDirective top fields body = do
Just patt -> drop 1 .
dropWhile (not . (patt `T.isInfixOf`))
Nothing -> id) $ contentLines'
- let contents' = T.unlines contentLines'' <> "\n"
+ let contents' = T.unlines contentLines''
case lookup "code" fields of
Just lang -> do
let classes = maybe [] T.words (lookup "class" fields)
@@ -494,7 +494,7 @@ includeDirective top fields body = do
Just _ -> return $ B.rawBlock "rst" contents'
Nothing -> do
setPosition $ newPos (T.unpack f) 1 1
- setInput contents'
+ setInput $ contents' <> "\n"
bs <- optional blanklines >>
(mconcat <$> many block)
setInput oldInput