aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-30 23:51:49 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-30 23:51:49 -0800
commitc7f6f779089e0336a7070cd2a9b614a8e98e9515 (patch)
treeaf939a1fa660cec9d842f18a58452718b46a8f7a /src/Text/Pandoc
parentd8272d03561e4429c62f6a0dbb1a1b6d70899321 (diff)
downloadpandoc-c7f6f779089e0336a7070cd2a9b614a8e98e9515.tar.gz
Support Sphinx-style math in RST writer.
http://sphinx.pocoo.org/latest/ext/math.html
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/RST.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs
index 125ed4f13..282935bbd 100644
--- a/src/Text/Pandoc/Writers/RST.hs
+++ b/src/Text/Pandoc/Writers/RST.hs
@@ -286,8 +286,9 @@ inlineToRST (Str str) = return $ text $ escapeString str
inlineToRST (Math t str) = do
modify $ \st -> st{ stHasMath = True }
return $ if t == InlineMath
- then ":math:`$" <> text str <> "$`"
- else ":math:`$$" <> text str <> "$$`"
+ then ":math:`" <> text str <> "`\\ "
+ else blankline $$ ".. math::" $$ blankline $$
+ nest 3 (text str) $$ blankline
inlineToRST (RawInline _ _) = return empty
inlineToRST (LineBreak) = return cr -- there's no line break in RST
inlineToRST Space = return space