RST reader: fix spurious newlines in some attributes from directives.
commita0bd5617e8859673078abdadd909ecb411a9b022
authorJohn MacFarlane <jgm@berkeley.edu>
dateSun 12 Jul 2020, 14:42 (6 years ago)
parentb57434c
src/Text/Pandoc/Readers/RST.hs+2−1
@@ -223,7 +223,8 @@ rawFieldListItem minIndent = try $ do
223223 first <- anyLine
224224 rest <- option "" $ try $ do lookAhead (count indent (char ' ') >> spaceChar)
225225 indentedBlock
226− let raw = (if T.null first then "" else first <> "\n") <> rest <> "\n"
226+ let raw = (if T.null first then "" else first <> "\n") <> rest <>
227+ (if T.null first && T.null rest then "" else "\n")
227228 return (name, raw)
228229
229230fieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])