aboutsummaryrefslogtreecommitdiff
path: root/src/Text
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2020-07-12 14:42:41 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2020-07-12 14:42:41 -0700
commite3217c3862ca1c4fe2538f4fc4e137c993b57c1b (patch)
tree7ffc4f755252ddab2cfbab71c6a48be43f6609c9 /src/Text
parent37e68a818bd0adafa4b90048eab0efc94a4980c4 (diff)
downloadpandoc-e3217c3862ca1c4fe2538f4fc4e137c993b57c1b.tar.gz
RST reader: fix spurious newlines in some attributes from directives.
Diffstat (limited to 'src/Text')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs
index 17defa422..7c25be486 100644
--- a/src/Text/Pandoc/Readers/RST.hs
+++ b/src/Text/Pandoc/Readers/RST.hs
@@ -223,7 +223,8 @@ rawFieldListItem minIndent = try $ do
first <- anyLine
rest <- option "" $ try $ do lookAhead (count indent (char ' ') >> spaceChar)
indentedBlock
- let raw = (if T.null first then "" else first <> "\n") <> rest <> "\n"
+ let raw = (if T.null first then "" else first <> "\n") <> rest <>
+ (if T.null first && T.null rest then "" else "\n")
return (name, raw)
fieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])