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.
This commit is contained in:
John MacFarlane 2022-01-08 19:39:26 -08:00
parent a6741bd555
commit 252211bd27
2 changed files with 2 additions and 18 deletions

View file

@ -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

View file

@ -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\)