From 000b89c718fdef3790a56fad9cbbfcdcf7fbea52 Mon Sep 17 00:00:00 2001 From: fiddlosopher Date: Mon, 8 Sep 2008 06:36:28 +0000 Subject: Use Data.List's 'intercalate' instead of custom 'joinWithSep'. + Removed joinWithSep definition from Text.Pandoc.Shared. + Replaced joinWithSep with intercalate + Depend on base >= 3, since in base < 3 intercalate is not included. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1428 788f1e2b-df1e-0410-8736-df70ead52e1b --- Text/Pandoc/Readers/RST.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Text/Pandoc/Readers/RST.hs') diff --git a/Text/Pandoc/Readers/RST.hs b/Text/Pandoc/Readers/RST.hs index 08e55f97d..5533d309f 100644 --- a/Text/Pandoc/Readers/RST.hs +++ b/Text/Pandoc/Readers/RST.hs @@ -33,7 +33,7 @@ module Text.Pandoc.Readers.RST ( import Text.Pandoc.Definition import Text.Pandoc.Shared import Text.ParserCombinators.Parsec -import Data.List ( findIndex, delete ) +import Data.List ( findIndex, delete, intercalate ) -- | Parse reStructuredText string and return Pandoc document. readRST :: ParserState -> String -> Pandoc @@ -144,7 +144,7 @@ fieldListItem indent = try $ do first <- manyTill anyChar newline rest <- option "" $ try $ lookAhead (string indent >> oneOf " \t") >> indentedBlock - return (name, joinWithSep " " (first:(lines rest))) + return (name, intercalate " " (first:(lines rest))) fieldList :: GenParser Char ParserState Block fieldList = try $ do @@ -583,7 +583,7 @@ code :: GenParser Char ParserState Inline code = try $ do string "``" result <- manyTill anyChar (try (string "``")) - return $ Code $ removeLeadingTrailingSpace $ joinWithSep " " $ lines result + return $ Code $ removeLeadingTrailingSpace $ intercalate " " $ lines result emph :: GenParser Char ParserState Inline emph = enclosed (char '*') (char '*') inline >>= -- cgit v1.2.3