@@ -658,7 +658,11 @@ getReference label (src, tit) = do
658658-- | Convert list of Pandoc inline elements to markdown.
659659inlineListToMarkdown :: WriterOptions -> [Inline] -> State WriterState Doc
660660inlineListToMarkdown opts lst =
661− mapM (inlineToMarkdown opts) lst >>= return . cat
661+ mapM (inlineToMarkdown opts) (avoidBadWraps lst) >>= return . cat
662+ where avoidBadWraps [] = []
663+ avoidBadWraps (Space:Str (c:cs):xs)
664+ | c `elem` "-*+>" = Str (' ':c:cs) : avoidBadWraps xs
665+ avoidBadWraps (x:xs) = x : avoidBadWraps xs
662666
663667escapeSpaces :: Inline -> Inline
664668escapeSpaces (Str s) = Str $ substitute " " "\\ " s