git.iko.soy/typeable/pandoc
on master help sign in
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.

commit632fd49d07cb6f286fb11dc9512115bff39049fd authorJohn MacFarlane <jgm@berkeley.edu> dateFri 28 Sep 2012, 23:29 (14 years ago) parentd6ddc2f
1 file changed+5−2
src/Text/Pandoc/Readers/Textile.hs+5−2
src/Text/Pandoc/Readers/Textile.hs+5−2
@@ -327,7 +327,7 @@ maybeExplicitBlock :: String -- ^ block tag name
327327 -> Parser [Char] ParserState Block
328328maybeExplicitBlock name blk = try $ do
329329 optional $ try $ string name >> optional attributes >> char '.' >>
330− ((try whitespace) <|> endline)
330+ optional whitespace >> optional endline
331331 blk
332332
333333
@@ -427,7 +427,10 @@ wordBoundaries = markupChars ++ stringBreakers
427427
428428-- | Parse a hyphened sequence of words
429429hyphenedWords :: Parser [Char] ParserState String
430−hyphenedWords = intercalate "-" <$> sepBy1 wordChunk (char '-')
430+hyphenedWords = do
431+ x <- wordChunk
432+ xs <- many (try $ char '-' >> wordChunk)
433+ return $ intercalate "-" (x:xs)
431434
432435wordChunk :: Parser [Char] ParserState String
433436wordChunk = try $ do