aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-25 02:01:41 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2009-06-25 02:01:41 +0000
commit313405f59aa09b6f1a027002d35bc75cb15c976e (patch)
tree64e02b18b5342caa4e52ce382478d6c99650dc69 /src/Text
parent15258f66f082879a4c49f0130ed05cac32074a1b (diff)
downloadpandoc-313405f59aa09b6f1a027002d35bc75cb15c976e.tar.gz
Allow continuation lines in line blocks.
Also added test cases for line blocks for RST reader. Resolves Issue #149. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1583 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index ae025f4ea..4fe6ada5e 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -125,8 +125,8 @@ block = choice [ codeBlock
, unknownDirective
, header
, hrule
+ , lineBlock -- must go before definitionList
, list
- , lineBlock
, lhsCodeBlock
, para
, plain
@@ -183,14 +183,15 @@ lineBlockLine :: GenParser Char ParserState [Inline]
lineBlockLine = try $ do
string "| "
white <- many (oneOf " \t")
- line <- manyTill inline newline
- return $ (if null white then [] else [Str white]) ++ line ++ [LineBreak]
+ line <- many $ (notFollowedBy newline >> inline) <|> (try $ endline >>~ char ' ')
+ optional endline
+ return $ normalizeSpaces $ (if null white then [] else [Str white]) ++ line
lineBlock :: GenParser Char ParserState Block
lineBlock = try $ do
lines' <- many1 lineBlockLine
blanklines
- return $ Para (concat lines')
+ return $ Para (intercalate [LineBreak] lines')
--
-- paragraph block