aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-08-26 21:30:00 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2017-08-26 21:30:00 -0700
commit64376955745cf4fd407947eb8022460bf498176b (patch)
tree546bd5711ac4c861a601a8bfb0e5bc89e8996c7a
parent1b3431a165309aad3a28a0e8a75755c299561280 (diff)
downloadpandoc-64376955745cf4fd407947eb8022460bf498176b.tar.gz
Markdown writer: don't crash on Str "".
-rw-r--r--src/Text/Pandoc/Writers/Markdown.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs
index 95977ce17..523dfeaed 100644
--- a/src/Text/Pandoc/Writers/Markdown.hs
+++ b/src/Text/Pandoc/Writers/Markdown.hs
@@ -931,7 +931,7 @@ avoidBadWrapsInList (s:Str cs:[])
avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs
isOrderedListMarker :: String -> Bool
-isOrderedListMarker xs = (last xs `elem` ['.',')']) &&
+isOrderedListMarker xs = not (null xs) && (last xs `elem` ['.',')']) &&
isRight (runParser (anyOrderedListMarker >> eof)
defaultParserState "" xs)