From cdefeb9445afc7e8ea42e9ff0fdc69cfc8060c1d Mon Sep 17 00:00:00 2001 From: Denis Laxalde <denis@laxalde.org> Date: Wed, 29 Aug 2012 18:54:57 +0200 Subject: [PATCH 1/2] Fix RST reader for field lists items with body beginning after a new line --- src/Text/Pandoc/Readers/RST.hs | 2 +- tests/rst-reader.rst | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 9fb976903..af1789be7 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -152,7 +152,7 @@ rawFieldListItem indent = try $ do string indent char ':' name <- many1 $ alphaNum <|> spaceChar - string ": " + char ':' skipSpaces first <- manyTill anyChar newline rest <- option "" $ try $ do lookAhead (string indent >> spaceChar) diff --git a/tests/rst-reader.rst b/tests/rst-reader.rst index 4d81ccb85..e8dee7e3f 100644 --- a/tests/rst-reader.rst +++ b/tests/rst-reader.rst @@ -279,7 +279,8 @@ Field Lists :address: 61 Main St. :city: *Nowhere*, MA, USA -:phone: 123-4567 +:phone: + 123-4567 HTML Blocks =========== From b981540f2eee0a43acca7e446e24f76148d528b7 Mon Sep 17 00:00:00 2001 From: Denis Laxalde <denis@laxalde.org> Date: Wed, 29 Aug 2012 20:35:19 +0200 Subject: [PATCH 2/2] Allow any char but ':' in names of field lists in RST reader --- src/Text/Pandoc/Readers/RST.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index af1789be7..a26b1623d 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -151,7 +151,7 @@ rawFieldListItem :: String -> Parser [Char] ParserState (String, String) rawFieldListItem indent = try $ do string indent char ':' - name <- many1 $ alphaNum <|> spaceChar + name <- many1 $ noneOf ":" char ':' skipSpaces first <- manyTill anyChar newline