Allow '|' followed by newline in RST line block.
This commit is contained in:
parent
6b282fda5b
commit
4b90ffe1bd
2 changed files with 9 additions and 3 deletions
|
@ -17,7 +17,10 @@ infix 5 =:
|
|||
(=:) = test rst
|
||||
|
||||
tests :: [Test]
|
||||
tests = [ "field list" =:
|
||||
tests = [ "line block with blank line" =:
|
||||
"| a\n|\n| b" =?> para (str "a" +++ linebreak +++
|
||||
linebreak +++ str " " +++ str "b")
|
||||
, "field list" =:
|
||||
[_LIT|
|
||||
:Hostname: media08
|
||||
:IP address: 10.0.0.19
|
||||
|
|
|
@ -198,11 +198,14 @@ fieldList = try $ do
|
|||
|
||||
lineBlockLine :: GenParser Char ParserState [Inline]
|
||||
lineBlockLine = try $ do
|
||||
string "| "
|
||||
char '|'
|
||||
char ' ' <|> lookAhead (char '\n')
|
||||
white <- many spaceChar
|
||||
line <- many $ (notFollowedBy newline >> inline) <|> (try $ endline >>~ char ' ')
|
||||
optional endline
|
||||
return $ normalizeSpaces $ (if null white then [] else [Str white]) ++ line
|
||||
return $ if null white
|
||||
then normalizeSpaces line
|
||||
else Str white : normalizeSpaces line
|
||||
|
||||
lineBlock :: GenParser Char ParserState Block
|
||||
lineBlock = try $ do
|
||||
|
|
Loading…
Add table
Reference in a new issue