aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-07-26 12:50:36 +0200
committerJohn MacFarlane <jgm@berkeley.edu>2017-07-26 12:50:36 +0200
commite0ab09611a8ab42c69da81ed3fd3c3df8c0c70de (patch)
tree6465265326a1a2e8a0af5881da2d25c3242102dd /src/Text/Pandoc
parent2daab579f4eef9ef61da460c731a45a77433a472 (diff)
downloadpandoc-e0ab09611a8ab42c69da81ed3fd3c3df8c0c70de.tar.gz
HTML writer: render raw inline environments when --mathjax used.
We previously did this only with raw blocks, on the assumption that math environments would always be raw blocks. This has changed since we now parse them as inline environments. Closes #3816.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index d09158c42..61f2c959a 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -1007,9 +1007,14 @@ inlineToHtml opts inline = do
ishtml <- isRawHtml f
if ishtml
then return $ preEscapedString str
- else do
- report $ InlineNotRendered inline
- return mempty
+ else if (f == Format "latex" || f == Format "tex") &&
+ "\\begin" `isPrefixOf` str &&
+ allowsMathEnvironments (writerHTMLMathMethod opts) &&
+ isMathEnvironment str
+ then inlineToHtml opts $ Math DisplayMath str
+ else do
+ report $ InlineNotRendered inline
+ return mempty
(Link attr txt (s,_)) | "mailto:" `isPrefixOf` s -> do
linkText <- inlineListToHtml opts txt
obfuscateLink opts attr linkText s