diff options
Diffstat (limited to 'Text/Pandoc/Writers/RST.hs')
-rw-r--r-- | Text/Pandoc/Writers/RST.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Text/Pandoc/Writers/RST.hs b/Text/Pandoc/Writers/RST.hs index 9215f051d..de65bcf0e 100644 --- a/Text/Pandoc/Writers/RST.hs +++ b/Text/Pandoc/Writers/RST.hs @@ -291,14 +291,16 @@ inlineToRST Apostrophe = return $ char '\'' inlineToRST Ellipses = return $ text "..." inlineToRST (Code str) = return $ text $ "``" ++ str ++ "``" inlineToRST (Str str) = return $ text $ escapeString str -inlineToRST (Math str) = do +inlineToRST (Math t str) = do includes <- get >>= (return . stIncludes) let rawMathRole = ".. role:: math(raw)\n" ++ " :format: html latex\n" if not (rawMathRole `elem` includes) then modify $ \st -> st { stIncludes = rawMathRole : includes } else return () - return $ text $ ":math:`$" ++ str ++ "$`" + return $ if t == InlineMath + then text $ ":math:`$" ++ str ++ "$`" + else text $ ":math:`$$" ++ str ++ "$$`" inlineToRST (TeX _) = return empty inlineToRST (HtmlInline _) = return empty inlineToRST (LineBreak) = do |