Support Sphinx-style math in RST writer.
http://sphinx.pocoo.org/latest/ext/math.html
This commit is contained in:
parent
d8272d0356
commit
c7f6f77908
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue