aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2017-02-11 00:20:45 +0100
committerJohn MacFarlane <jgm@berkeley.edu>2017-02-11 00:20:45 +0100
commit31f5c02743178a9fe7b8684b489d342ff07f1967 (patch)
treeca7110f48bf9980b66ac7c340b80e5cec638a5ee
parent76c55466d3087224eccdc47c804ab2904be50df5 (diff)
downloadpandoc-31f5c02743178a9fe7b8684b489d342ff07f1967.tar.gz
HTML writer: report when not rendering raw inline/block.
-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 64eccd35e..99f8c5b42 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -82,7 +82,8 @@ import System.FilePath (takeExtension)
import Data.Aeson (Value)
import Control.Monad.Except (throwError)
import Text.Pandoc.Error
-import Text.Pandoc.Class (PandocMonad)
+import Text.Pandoc.Class (PandocMonad, report)
+import Text.Pandoc.Logging
data WriterState = WriterState
{ stNotes :: [Html] -- ^ List of notes
@@ -591,7 +592,9 @@ blockToHtml opts (RawBlock f str)
| (f == Format "latex" || f == Format "tex") &&
allowsMathEnvironments (writerHTMLMathMethod opts) &&
isMathEnvironment str = blockToHtml opts $ Plain [Math DisplayMath str]
- | otherwise = return mempty
+ | otherwise = do
+ report $ BlockNotRendered (RawBlock f str)
+ return mempty
blockToHtml _ (HorizontalRule) = do
html5 <- gets stHtml5
return $ if html5 then H5.hr else H.hr
@@ -925,7 +928,9 @@ inlineToHtml opts inline = do
DisplayMath -> brtag >> m >> brtag
(RawInline f str)
| f == Format "html" -> return $ preEscapedString str
- | otherwise -> return mempty
+ | otherwise -> do
+ report $ InlineNotRendered inline
+ return mempty
(Link attr txt (s,_)) | "mailto:" `isPrefixOf` s -> do
linkText <- inlineListToHtml opts txt
lift $ obfuscateLink opts attr linkText s