git.iko.soy/typeable/pandoc
on master help sign in
Allow '|' followed by newline in RST line block.
commit4b90ffe1bd481c9330ffdad455676df6fe2fa6d4 authorJohn MacFarlane <jgm@berkeley.edu> dateMon 11 Apr 2011, 14:45 (16 years ago) parent6b282fd
2 files changed+9−3
src/Tests/Readers/RST.hs+4−1 src/Text/Pandoc/Readers/RST.hs+5−2
src/Tests/Readers/RST.hs+4−1
@@ -17,7 +17,10 @@ infix 5 =:
1717(=:) = test rst
1818
1919tests :: [Test]
20−tests = [ "field list" =:
20+tests = [ "line block with blank line" =:
21+ "| a\n|\n| b" =?> para (str "a" +++ linebreak +++
22+ linebreak +++ str " " +++ str "b")
23+ , "field list" =:
2124 [_LIT|
2225:Hostname: media08
2326:IP address: 10.0.0.19
src/Text/Pandoc/Readers/RST.hs+5−2
@@ -198,11 +198,14 @@ fieldList = try $ do
198198
199199lineBlockLine :: GenParser Char ParserState [Inline]
200200lineBlockLine = try $ do
201− string "| "
201+ char '|'
202+ char ' ' <|> lookAhead (char '\n')
202203 white <- many spaceChar
203204 line <- many $ (notFollowedBy newline >> inline) <|> (try $ endline >>~ char ' ')
204205 optional endline
205− return $ normalizeSpaces $ (if null white then [] else [Str white]) ++ line
206+ return $ if null white
207+ then normalizeSpaces line
208+ else Str white : normalizeSpaces line
206209
207210lineBlock :: GenParser Char ParserState Block
208211lineBlock = try $ do