diff options
author | John MacFarlane <jgm@berkeley.edu> | 2020-07-12 13:53:10 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2020-07-12 13:53:10 -0700 |
commit | 37e68a818bd0adafa4b90048eab0efc94a4980c4 (patch) | |
tree | fb5e9f1917f9285c466c050bd2946c9418442629 /src | |
parent | bf7c624c809fc3ee510f3d15b6e0aea5d8c262f7 (diff) | |
download | pandoc-37e68a818bd0adafa4b90048eab0efc94a4980c4.tar.gz |
RST reader: avoid extra newline in included code blocks.
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 4 |
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 |