aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2011-01-24 22:25:17 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2011-01-26 17:23:56 -0800
commit422bba202ef6731f0487880f08200f5dc9d6bbb0 (patch)
treee6a5f9ed450ae7647f8a525bce9f56227693bbd8 /src/Text
parente66cc6728c046861183f520adef1f9f427a8df9e (diff)
downloadpandoc-422bba202ef6731f0487880f08200f5dc9d6bbb0.tar.gz
RST reader: Include line breaks in raw field list parser output.
Note: field list items can have lists, etc. as values.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index fee932f2b..371cbc0f3 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -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