From 632fd49d07cb6f286fb11dc9512115bff39049fd Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Fri, 28 Sep 2012 23:29:54 -0400 Subject: Textile reader: Fixed bug affected words ending in hyphen. Note: sepBy1 doesn't work quite as I expected. It gives odd results if sep succeeds but not p. --- src/Text/Pandoc/Readers/Textile.hs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Readers/Textile.hs b/src/Text/Pandoc/Readers/Textile.hs index 41600c7ee..170ccc2c7 100644 --- a/src/Text/Pandoc/Readers/Textile.hs +++ b/src/Text/Pandoc/Readers/Textile.hs @@ -327,7 +327,7 @@ maybeExplicitBlock :: String -- ^ block tag name -> Parser [Char] ParserState Block maybeExplicitBlock name blk = try $ do optional $ try $ string name >> optional attributes >> char '.' >> - ((try whitespace) <|> endline) + optional whitespace >> optional endline blk @@ -427,7 +427,10 @@ wordBoundaries = markupChars ++ stringBreakers -- | Parse a hyphened sequence of words hyphenedWords :: Parser [Char] ParserState String -hyphenedWords = intercalate "-" <$> sepBy1 wordChunk (char '-') +hyphenedWords = do + x <- wordChunk + xs <- many (try $ char '-' >> wordChunk) + return $ intercalate "-" (x:xs) wordChunk :: Parser [Char] ParserState String wordChunk = try $ do -- cgit v1.2.3