From 37e68a818bd0adafa4b90048eab0efc94a4980c4 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 12 Jul 2020 13:53:10 -0700 Subject: RST reader: avoid extra newline in included code blocks. --- src/Text/Pandoc/Readers/RST.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3