diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-25 12:24:33 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-25 12:24:33 -0800 |
commit | 25e2c42347b9bf71b765984d3d897fae8b1a2edb (patch) | |
tree | f591328610e3fd3bafe3af444aa31efae24ddced | |
parent | dc92a628833a3bf8f528c480fac80d926f63f9b6 (diff) | |
download | pandoc-25e2c42347b9bf71b765984d3d897fae8b1a2edb.tar.gz |
RST writer: Omit blank lines after list items.
They are optional in RST (except after the last list item,
of course).
Fixes #1777.
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 6 | ||||
-rw-r--r-- | tests/writer.rst | 24 |
2 files changed, 4 insertions, 26 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 40d6fdf18..85d395f52 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -274,7 +274,7 @@ blockToRST (DefinitionList items) = do bulletListItemToRST :: [Block] -> State WriterState Doc bulletListItemToRST items = do contents <- blockListToRST items - return $ hang 3 "- " $ contents <> cr + return $ hang 3 "- " contents -- | Convert ordered list item (a list of blocks) to RST. orderedListItemToRST :: String -- ^ marker for list item @@ -283,7 +283,7 @@ orderedListItemToRST :: String -- ^ marker for list item orderedListItemToRST marker items = do contents <- blockListToRST items let marker' = marker ++ " " - return $ hang (length marker') (text marker') $ contents <> cr + return $ hang (length marker') (text marker') contents -- | Convert defintion list item (label, list of blocks) to RST. definitionListItemToRST :: ([Inline], [[Block]]) -> State WriterState Doc @@ -291,7 +291,7 @@ definitionListItemToRST (label, defs) = do label' <- inlineListToRST label contents <- liftM vcat $ mapM blockListToRST defs tabstop <- get >>= (return . writerTabStop . stOptions) - return $ label' $$ nest tabstop (nestle contents <> cr) + return $ label' $$ nest tabstop (nestle contents) -- | Convert list of Pandoc block elements to RST. blockListToRST :: [Block] -- ^ List of block elements diff --git a/tests/writer.rst b/tests/writer.rst index 1a998d2ae..8209105bf 100644 --- a/tests/writer.rst +++ b/tests/writer.rst @@ -136,9 +136,7 @@ Asterisks tight: Asterisks loose: - asterisk 1 - - asterisk 2 - - asterisk 3 Pluses tight: @@ -150,9 +148,7 @@ Pluses tight: Pluses loose: - Plus 1 - - Plus 2 - - Plus 3 Minuses tight: @@ -164,9 +160,7 @@ Minuses tight: Minuses loose: - Minus 1 - - Minus 2 - - Minus 3 Ordered @@ -187,17 +181,13 @@ and: Loose using tabs: 1. First - 2. Second - 3. Third and using spaces: 1. One - 2. Two - 3. Three Multiple paragraphs: @@ -205,9 +195,7 @@ Multiple paragraphs: 1. Item 1, graf one. Item 1. graf two. The quick brown fox jumped over the lazy dog’s back. - 2. Item 2. - 3. Item 3. Nested @@ -227,30 +215,25 @@ Here’s another: - Fee - Fie - Foe - 3. Third Same thing but with paragraphs: 1. First - 2. Second: - Fee - Fie - Foe - 3. Third Tabs and spaces --------------- - this is a list item indented with tabs - - this is a list item indented with spaces - this is an example list item indented with tabs - - this is an example list item indented with spaces Fancy list markers @@ -317,10 +300,8 @@ Loose: apple red fruit - orange orange fruit - banana yellow fruit @@ -330,7 +311,6 @@ Multiple blocks with italics: red fruit contains seeds, crisp, pleasant to taste - *orange* orange fruit @@ -355,7 +335,6 @@ apple red fruit computer - orange orange fruit @@ -367,7 +346,6 @@ apple red fruit computer - orange orange fruit @@ -666,7 +644,6 @@ LaTeX - Here’s some display math: .. math:: \frac{d}{dx}f(x)=\lim_{h\to 0}\frac{f(x+h)-f(x)}{h} - - Here’s one that has a line break in it: :math:`\alpha + \omega \times x^2`. These shouldn’t be math: @@ -839,6 +816,7 @@ From “Voyage dans la Lune” by Georges Melies (1902): :alt: Voyage dans la Lune lalune + Here is a movie |movie| icon. -------------- |