RST reader: Include line breaks in raw field list parser output.

Note: field list items can have lists, etc. as values.
This commit is contained in:
John MacFarlane 2011-01-24 22:25:17 -08:00
parent e66cc6728c
commit 422bba202e

View file

@ -152,7 +152,9 @@ fieldListItem indent = try $ do
first <- manyTill anyChar newline
rest <- option "" $ try $ lookAhead (string indent >> spaceChar) >>
indentedBlock
return (name, intercalate " " (first:(lines rest)))
return (name, first ++ if null rest
then ""
else ("\n" ++ rest))
fieldList :: GenParser Char ParserState Block
fieldList = try $ do