git.iko.soy/typeable/pandoc
on master help sign in
Textile reader: Fixed bug affected words ending in hyphen.
632fd49John MacFarlane
src/Text/Pandoc/Readers/Textile.hs+5−2
@@ -327,7 +327,7 @@ maybeExplicitBlock :: String -- ^ block tag name
327 -> Parser [Char] ParserState Block
327 -> Parser [Char] ParserState Block
328maybeExplicitBlock name blk = try $ do
328maybeExplicitBlock name blk = try $ do
329 optional $ try $ string name >> optional attributes >> char '.' >>
329 optional $ try $ string name >> optional attributes >> char '.' >>
330− ((try whitespace) <|> endline)
330+ optional whitespace >> optional endline
331 blk
331 blk
332
332
333
333
@@ -427,7 +427,10 @@ wordBoundaries = markupChars ++ stringBreakers
427
427
428-- | Parse a hyphened sequence of words
428-- | Parse a hyphened sequence of words
429hyphenedWords :: Parser [Char] ParserState String
429hyphenedWords :: 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)
431
434
432wordChunk :: Parser [Char] ParserState String
435wordChunk :: Parser [Char] ParserState String
433wordChunk = try $ do
436wordChunk = try $ do