Skip to content

Commit

Permalink
HTML writer: include raw latex blocks if --mathjax specified.
Browse files Browse the repository at this point in the history
Closes #1938.
  • Loading branch information
jgm committed Feb 26, 2015
1 parent 4b43531 commit 4f0c5c3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Text/Pandoc/Writers/HTML.hs
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,13 @@ blockToHtml opts (Div attr@(_,classes,_) bs) = do
NoSlides -> addAttrs opts' attr $ H.div $ contents'
_ -> mempty
else addAttrs opts attr $ H.div $ contents'
blockToHtml _ (RawBlock f str)
blockToHtml opts (RawBlock f str)
| f == Format "html" = return $ preEscapedString str
| f == Format "latex" =
case writerHTMLMathMethod opts of
MathJax _ -> do modify (\st -> st{ stMath = True })
return $ toHtml str
_ -> return mempty
| otherwise = return mempty
blockToHtml opts (HorizontalRule) = return $ if writerHtml5 opts then H5.hr else H.hr
blockToHtml opts (CodeBlock (id',classes,keyvals) rawCode) = do
Expand Down Expand Up @@ -769,6 +774,8 @@ inlineToHtml opts inline =
case writerHTMLMathMethod opts of
LaTeXMathML _ -> do modify (\st -> st {stMath = True})
return $ toHtml str
MathJax _ -> do modify (\st -> st {stMath = True})
return $ toHtml str
_ -> return mempty
| f == Format "html" -> return $ preEscapedString str
| otherwise -> return mempty
Expand Down

0 comments on commit 4f0c5c3

Please sign in to comment.