git.iko.soy/typeable/pandoc
on master help sign in
Markdown/RST reader: Skip blank lines.
72d11adJohn MacFarlane
src/Text/Pandoc/Readers/Markdown.hs+2−1
@@ -373,6 +373,7 @@ block = choice [ codeBlockFenced
373 , abbrevKey
373 , abbrevKey
374 , para
374 , para
375 , plain
375 , plain
376+ , mempty <$ blanklines
376 ] <?> "block"
377 ] <?> "block"
377
378
378--
379--
@@ -807,7 +808,7 @@ para = try $ do
807 _ -> return $ B.para result'
808 _ -> return $ B.para result'
808
809
809plain :: MarkdownParser (F Blocks)
810plain :: MarkdownParser (F Blocks)
810−plain = fmap B.plain . trimInlinesF . mconcat <$> many1 inline <* spaces
811+plain = fmap B.plain . trimInlinesF . mconcat <$> many1 inline
811
812
812--
813--
813-- raw html
814-- raw html
src/Text/Pandoc/Readers/RST.hs+1
@@ -143,6 +143,7 @@ block = choice [ codeBlock
143 , list
143 , list
144 , lhsCodeBlock
144 , lhsCodeBlock
145 , para
145 , para
146+ , mempty <$ blanklines
146 ] <?> "block"
147 ] <?> "block"
147
148
148--
149--
tests/markdown-reader-more.native+7−1
@@ -118,4 +118,10 @@
118 [[Plain [Str "b"]]
118 [[Plain [Str "b"]]
119 ,[Plain [Str "b",Space,Str "2"]]
119 ,[Plain [Str "b",Space,Str "2"]]
120 ,[Plain [Str "b",Space,Str "2"]]]]
120 ,[Plain [Str "b",Space,Str "2"]]]]
121− ,[Para [Str "c",Space,Str "c",Space,Str "2",Space,Str "c",Space,Str "2"]]]]]
121+ ,[Para [Str "c",Space,Str "c",Space,Str "2",Space,Str "c",Space,Str "2"]]]]
122+,Para [Str "Empty",Space,Str "cells"]
123+,Table [] [AlignDefault,AlignDefault] [5.555555555555555e-2,5.555555555555555e-2]
124+ [[]
125+ ,[]]
126+ [[[]
127+ ,[]]]]
tests/markdown-reader-more.txt+10−3
@@ -196,8 +196,15 @@ Multiple blocks in a cell
196+------------------+-----------+------------+
196+------------------+-----------+------------+
197| # col 1 | # col 2 | # col 3 |
197| # col 1 | # col 2 | # col 3 |
198| col 1 | col 2 | col 3 |
198| col 1 | col 2 | col 3 |
199−+------------------+-----------+------------+
199++------------------+-----------+------------+
200| r1 a | - b | c |
200| r1 a | - b | c |
201−| | - b 2 | c 2 |
201+| | - b 2 | c 2 |
202−| r1 bis | - b 2 | c 2 |
202+| r1 bis | - b 2 | c 2 |
203+------------------+-----------+------------+
203+------------------+-----------+------------+
204+
205+Empty cells
206+
207++---+---+
208+| | |
209++---+---+
210+