git.iko.soy/typeable/pandoc
on master help sign in
Markdown writer: don't crash on Str "".
6437695John MacFarlane
src/Text/Pandoc/Writers/Markdown.hs+1−1
@@ -931,7 +931,7 @@ avoidBadWrapsInList (s:Str cs:[])
931avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs
931avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs
932
932
933isOrderedListMarker :: String -> Bool
933isOrderedListMarker :: String -> Bool
934−isOrderedListMarker xs = (last xs `elem` ['.',')']) &&
934+isOrderedListMarker xs = not (null xs) && (last xs `elem` ['.',')']) &&
935 isRight (runParser (anyOrderedListMarker >> eof)
935 isRight (runParser (anyOrderedListMarker >> eof)
936 defaultParserState "" xs)
936 defaultParserState "" xs)
937
937