From 7ace7dd66b3b82edaafeb822d8d0f9318feb8b79 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 4 Dec 2016 17:13:06 +0100 Subject: [PATCH] Markdown writer: Fixed incorrect word wrapping. Previously pandoc would sometimes wrap lines too early due to this bug. Closes #3277. --- src/Text/Pandoc/Writers/Markdown.hs | 2 +- tests/writer.markdown | 4 ++-- tests/writer.opml | 4 ++-- tests/writer.plain | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Text/Pandoc/Writers/Markdown.hs b/src/Text/Pandoc/Writers/Markdown.hs index 3a6ea77ac..d08998eef 100644 --- a/src/Text/Pandoc/Writers/Markdown.hs +++ b/src/Text/Pandoc/Writers/Markdown.hs @@ -858,7 +858,7 @@ avoidBadWrapsInList (x:xs) = x : avoidBadWrapsInList xs isOrderedListMarker :: String -> Bool isOrderedListMarker xs = (last xs `elem` ['.',')']) && - isRight (runParserT (anyOrderedListMarker >> eof) + isRight (runParser (anyOrderedListMarker >> eof) defaultParserState "" xs) isRight :: Either a b -> Bool diff --git a/tests/writer.markdown b/tests/writer.markdown index f59174023..4f91a803b 100644 --- a/tests/writer.markdown +++ b/tests/writer.markdown @@ -548,8 +548,8 @@ LaTeX These shouldn’t be math: - To get the famous equation, write `$e = mc^2$`. -- \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot” - is emphasized.) +- \$22,000 is a *lot* of money. So is \$34,000. (It worked if “lot” is + emphasized.) - Shoes (\$20) and socks (\$5). - Escaped `$`: \$73 *this should be emphasized* 23\$. diff --git a/tests/writer.opml b/tests/writer.opml index 8b4dea3b1..c94a88f77 100644 --- a/tests/writer.opml +++ b/tests/writer.opml @@ -33,7 +33,7 @@ - + @@ -50,7 +50,7 @@ - + diff --git a/tests/writer.plain b/tests/writer.plain index 0774e9465..f34af9100 100644 --- a/tests/writer.plain +++ b/tests/writer.plain @@ -498,8 +498,8 @@ LATEX These shouldn’t be math: - To get the famous equation, write $e = mc^2$. -- $22,000 is a _lot_ of money. So is $34,000. (It worked if “lot” - is emphasized.) +- $22,000 is a _lot_ of money. So is $34,000. (It worked if “lot” is + emphasized.) - Shoes ($20) and socks ($5). - Escaped $: $73 _this should be emphasized_ 23$.