From 4f4b0f031d17927b6787c9deee736cf0892cab70 Mon Sep 17 00:00:00 2001 From: Timothy Humphries Date: Sun, 12 Oct 2014 03:18:36 -0400 Subject: Respect indent when parsing Org bullet lists Fixes issue with top-level bullet list parsing. Previously we would use `many1 spaceChars` rather than respecting the list's indent level. We also permitted `*` bullets on unindented lists, which should unambiguously parse as `header 1`. Combined, this meant headers at a different indent level were being unwittingly slurped into preceding bullet lists, as per Issue #1650. --- tests/Tests/Readers/Org.hs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'tests/Tests') diff --git a/tests/Tests/Readers/Org.hs b/tests/Tests/Readers/Org.hs index 92ec8155b..f27388e46 100644 --- a/tests/Tests/Readers/Org.hs +++ b/tests/Tests/Readers/Org.hs @@ -622,6 +622,33 @@ tests = ] ] + , "Bullet List with Decreasing Indent" =: + (" - Discovery\n\ + \ - Human After All\n") =?> + mconcat [ bulletList [ plain "Discovery" ] + , bulletList [ plain ("Human" <> space <> "After" <> space <> "All")] + ] + + , "Header follows Bullet List" =: + (" - Discovery\n\ + \ - Human After All\n\ + \* Homework") =?> + mconcat [ bulletList [ plain "Discovery" + , plain ("Human" <> space <> "After" <> space <> "All") + ] + , header 1 "Homework" + ] + + , "Bullet List Unindented with trailing Header" =: + ("- Discovery\n\ + \- Homework\n\ + \* NotValidListItem") =?> + mconcat [ bulletList [ plain "Discovery" + , plain "Homework" + ] + , header 1 "NotValidListItem" + ] + , "Simple Ordered List" =: ("1. Item1\n" ++ "2. Item2\n") =?> -- cgit v1.2.3