aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2022-01-08 19:39:26 -0800
committerJohn MacFarlane <[email protected]>2022-01-08 19:39:26 -0800
commit252211bd275e34e64c77d260348cedaa17ba4667 (patch)
tree6c226a9aaf19add6c37b454adb06e34e1a388d90
parenta6741bd55525718b4e2eacd17ace07eb2646de08 (diff)
Org writer: don't add blank line before lists.
The code to do this was apparently copied over from the RST writer, but these blank lines aren't necessary or desirable in org. See #7810 comment 3.
-rw-r--r--src/Text/Pandoc/Writers/Org.hs8
-rw-r--r--test/writer.org12
2 files changed, 2 insertions, 18 deletions
diff --git a/src/Text/Pandoc/Writers/Org.hs b/src/Text/Pandoc/Writers/Org.hs
index 3b7845cc9..0cf33f5b6 100644
--- a/src/Text/Pandoc/Writers/Org.hs
+++ b/src/Text/Pandoc/Writers/Org.hs
@@ -197,9 +197,7 @@ blockToOrg (Table _ blkCapt specs thead tbody tfoot) = do
return $ head'' $$ body $$ caption $$ blankline
blockToOrg (BulletList items) = do
contents <- mapM bulletListItemToOrg items
- -- ensure that sublists have preceding blank line
- return $ blankline $$
- (if isTightList items then vcat else vsep) contents $$
+ return $ (if isTightList items then vcat else vsep) contents $$
blankline
blockToOrg (OrderedList (start, _, delim) items) = do
let delim' = case delim of
@@ -210,9 +208,7 @@ blockToOrg (OrderedList (start, _, delim) items) = do
counters = (case start of 1 -> Nothing; n -> Just n) : repeat Nothing
contents <- zipWithM (\x f -> f x) items $
zipWith orderedListItemToOrg markers counters
- -- ensure that sublists have preceding blank line
- return $ blankline $$
- (if isTightList items then vcat else vsep) contents $$
+ return $ (if isTightList items then vcat else vsep) contents $$
blankline
blockToOrg (DefinitionList items) = do
contents <- mapM definitionListItemToOrg items
diff --git a/test/writer.org b/test/writer.org
index 3a1fef604..3b0abef2b 100644
--- a/test/writer.org
+++ b/test/writer.org
@@ -230,18 +230,14 @@ Multiple paragraphs:
:PROPERTIES:
:CUSTOM_ID: nested
:END:
-
- Tab
-
- Tab
-
- Tab
Here's another:
1. First
2. Second:
-
- Fee
- Fie
- Foe
@@ -264,7 +260,6 @@ Same thing but with paragraphs:
:PROPERTIES:
:CUSTOM_ID: tabs-and-spaces
:END:
-
- this is a list item indented with tabs
- this is a list item indented with spaces
@@ -277,7 +272,6 @@ Same thing but with paragraphs:
:PROPERTIES:
:CUSTOM_ID: fancy-list-markers
:END:
-
2) [@2] begins with 2
3) and now 3
@@ -286,25 +280,20 @@ Same thing but with paragraphs:
4. [@4] sublist with roman numerals, starting with 4
5. more items
-
1) a subsublist
2) a subsublist
Nesting:
1. Upper Alpha
-
1. Upper Roman.
-
6) [@6] Decimal start with 6
-
3) [@3] Lower alpha with paren
Autonumbering:
1. Autonumber.
2. More.
-
1. Nested.
Should not be a list item:
@@ -598,7 +587,6 @@ Ellipses...and...and....
:PROPERTIES:
:CUSTOM_ID: latex
:END:
-
- \cite[22-23]{smith.1899}
- \(2+2=4\)
- \(x \in y\)