summaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-28 23:29:54 -0400
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-28 23:29:54 -0400
commit632fd49d07cb6f286fb11dc9512115bff39049fd (patch)
tree641a8c6665c3485e6225c4fd4b915aa376e3e1e7 /src/Text
parentd6ddc2ff614a66ca135ce44140f469500c3cb6b6 (diff)
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.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/Textile.hs7
1 files changed, 5 insertions, 2 deletions
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