From 8007dd97b5d403f54c218a178573a818ab80c667 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Sat, 19 Sep 2015 21:54:44 +0200 Subject: Make sure verse blocks can contain empty lines The previous verse parsing code made the faulty assumption that empty strings are valid (and empty) inlines. This isn't the case, so lines are changed to contain at least a newline. It would generally be nicer and faster to keep the newlines while splitting the string. However, this would require more code, which seems unjustified for a simple (and fairly rare) block as *verse*. This fixes #2402. --- tests/Tests/Readers/Org.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests') diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 5eed2c9f4..52aaea52e 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -1143,6 +1143,15 @@ tests = ] ] + , "Verse block with newlines" =: + unlines [ "#+BEGIN_VERSE" + , "foo" + , "" + , "bar" + , "#+END_VERSE" + ] =?> + para ("foo" <> linebreak <> linebreak <> "bar") + , "LaTeX fragment" =: unlines [ "\\begin{equation}" , "X_i = \\begin{cases}" -- cgit v1.2.3