RST reader: avoid extra newline in included code blocks.
This commit is contained in:
parent
bf7c624c80
commit
37e68a818b
1 changed files with 2 additions and 2 deletions
|
@ -484,7 +484,7 @@ includeDirective top fields body = do
|
||||||
Just patt -> drop 1 .
|
Just patt -> drop 1 .
|
||||||
dropWhile (not . (patt `T.isInfixOf`))
|
dropWhile (not . (patt `T.isInfixOf`))
|
||||||
Nothing -> id) $ contentLines'
|
Nothing -> id) $ contentLines'
|
||||||
let contents' = T.unlines contentLines'' <> "\n"
|
let contents' = T.unlines contentLines''
|
||||||
case lookup "code" fields of
|
case lookup "code" fields of
|
||||||
Just lang -> do
|
Just lang -> do
|
||||||
let classes = maybe [] T.words (lookup "class" fields)
|
let classes = maybe [] T.words (lookup "class" fields)
|
||||||
|
@ -494,7 +494,7 @@ includeDirective top fields body = do
|
||||||
Just _ -> return $ B.rawBlock "rst" contents'
|
Just _ -> return $ B.rawBlock "rst" contents'
|
||||||
Nothing -> do
|
Nothing -> do
|
||||||
setPosition $ newPos (T.unpack f) 1 1
|
setPosition $ newPos (T.unpack f) 1 1
|
||||||
setInput contents'
|
setInput $ contents' <> "\n"
|
||||||
bs <- optional blanklines >>
|
bs <- optional blanklines >>
|
||||||
(mconcat <$> many block)
|
(mconcat <$> many block)
|
||||||
setInput oldInput
|
setInput oldInput
|
||||||
|
|
Loading…
Add table
Reference in a new issue