git.iko.soy/typeable/pandoc
on master help sign in
RST reader: fix spurious newlines in some attributes from directives.
a0bd561John MacFarlane
src/Text/Pandoc/Readers/RST.hs+2−1
@@ -223,7 +223,8 @@ rawFieldListItem minIndent = try $ do
223 first <- anyLine
223 first <- anyLine
224 rest <- option "" $ try $ do lookAhead (count indent (char ' ') >> spaceChar)
224 rest <- option "" $ try $ do lookAhead (count indent (char ' ') >> spaceChar)
225 indentedBlock
225 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")
227 return (name, raw)
228 return (name, raw)
228
229
229fieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])
230fieldListItem :: PandocMonad m => Int -> RSTParser m (Inlines, [Blocks])