diff options
author | John MacFarlane <jgm@berkeley.edu> | 2021-09-23 08:49:52 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-09-23 08:49:52 -0700 |
commit | f0a6eb913d7ace9de720539efb8984ea00ac82db (patch) | |
tree | e3e86c17df0ce1b90fe95bf9ab2163caf48089ef /src/Text/Pandoc | |
parent | 0afb48cd384ea1663f88bda32d0d149dc9a6f6c5 (diff) | |
download | pandoc-f0a6eb913d7ace9de720539efb8984ea00ac82db.tar.gz |
HTML writer: render `\ref` and `\eqref` as inline math...
not display. See #7589.
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r-- | src/Text/Pandoc/Writers/HTML.hs | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs index f883bd6d8..8fc81ed24 100644 --- a/src/Text/Pandoc/Writers/HTML.hs +++ b/src/Text/Pandoc/Writers/HTML.hs @@ -1468,14 +1468,17 @@ inlineToHtml opts inline = do ishtml <- isRawHtml f if ishtml then return $ preEscapedText str - else if (f == Format "latex" || f == Format "tex") && - ((allowsMathEnvironments (writerHTMLMathMethod opts) && - isMathEnvironment str) || - (allowsRef (writerHTMLMathMethod opts) && isRef str)) - then inlineToHtml opts $ Math DisplayMath str - else do - report $ InlineNotRendered inline - return mempty + else do + let istex = f == Format "latex" || f == Format "tex" + let mm = writerHTMLMathMethod opts + case istex of + True + | allowsMathEnvironments mm && isMathEnvironment str + -> inlineToHtml opts $ Math DisplayMath str + | allowsRef mm && isRef str + -> inlineToHtml opts $ Math InlineMath str + _ -> do report $ InlineNotRendered inline + return mempty (Link attr txt (s,_)) | "mailto:" `T.isPrefixOf` s -> do linkText <- inlineListToHtml opts txt obfuscateLink opts attr linkText s |