@@ -379,7 +379,9 @@ blockListToRST = blockListToRST' False
379-- | Convert list of Pandoc inline elements to RST.
379-- | Convert list of Pandoc inline elements to RST.
380inlineListToRST :: PandocMonad m => [Inline] -> RST m Doc
380inlineListToRST :: PandocMonad m => [Inline] -> RST m Doc
381inlineListToRST lst =
381inlineListToRST lst =
382+ mapM inlineToRST ((stripLeadingTrailingSpace .
382− mapM inlineToRST (removeSpaceAfterDisplayMath $ insertBS lst) >>=
383+ removeSpaceAfterDisplayMath .
383 return . hcat
385 return . hcat
384 where -- remove spaces after displaymath, as they screw up indentation:
386 where -- remove spaces after displaymath, as they screw up indentation:
385 removeSpaceAfterDisplayMath (Math DisplayMath x : zs) =
387 removeSpaceAfterDisplayMath (Math DisplayMath x : zs) =