@@ -61,6 +61,7 @@ import Text.Pandoc.Parsing
6161import Text.Pandoc.Readers.HTML ( htmlTag, isInlineTag, isBlockTag )
6262import Text.Pandoc.Readers.LaTeX ( rawLaTeXInline, rawLaTeXBlock )
6363import Text.HTML.TagSoup.Match
64+import Data.List ( intercalate )
6465import Data.Char ( digitToInt, isUpper )
6566import Control.Monad ( guard, liftM )
6667import Control.Applicative ((<$>), (*>), (<*))
@@ -426,14 +427,15 @@ wordBoundaries = markupChars ++ stringBreakers
426427
427428-- | Parse a hyphened sequence of words
428429hyphenedWords :: Parser [Char] ParserState String
429−hyphenedWords = try $ do
430+hyphenedWords = intercalate "-" <$> sepBy1 wordChunk (char '-')
431+
432+wordChunk :: Parser [Char] ParserState String
433+wordChunk = try $ do
430434 hd <- noneOf wordBoundaries
431435 tl <- many ( (noneOf wordBoundaries) <|>
432436 try (notFollowedBy' note *> oneOf markupChars
433437 <* lookAhead (noneOf wordBoundaries) ) )
434− let wd = hd:tl
435− option wd $ try $
436− (\r -> concat [wd, "-", r]) <$> (char '-' *> hyphenedWords)
438+ return $ hd:tl
437439
438440-- | Any string
439441str :: Parser [Char] ParserState Inline