From 31f5c02743178a9fe7b8684b489d342ff07f1967 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 11 Feb 2017 00:20:45 +0100 Subject: HTML writer: report when not rendering raw inline/block. --- src/Text/Pandoc/Writers/HTML.hs | 11 ++++++++--- 1 file 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 -- cgit v1.2.3