From a4bd650277ac8fd2c952f2330e4d23a200d691a5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 3 Dec 2016 18:42:17 +0100 Subject: Class: rename addWarning[WithPos] to warning[WithPos]. There's already a function addWarning in Parsing! Maybe we can dispense with that now, but I still like 'warning' better as a name. --- src/Text/Pandoc/Writers/RTF.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Text/Pandoc/Writers/RTF.hs') diff --git a/src/Text/Pandoc/Writers/RTF.hs b/src/Text/Pandoc/Writers/RTF.hs index 32f70cb31..a3351a705 100644 --- a/src/Text/Pandoc/Writers/RTF.hs +++ b/src/Text/Pandoc/Writers/RTF.hs @@ -36,7 +36,7 @@ import Text.Pandoc.Writers.Shared import Text.Pandoc.Writers.Math import Text.Pandoc.Templates (renderTemplate') import Text.Pandoc.Walk -import Text.Pandoc.Class (addWarning) +import Text.Pandoc.Class (warning) import Data.List ( isSuffixOf, intercalate ) import Data.Char ( ord, chr, isDigit ) import qualified Data.ByteString as B @@ -64,7 +64,7 @@ rtfEmbedImage opts x@(Image attr _ (src,_)) = do _ -> throwError $ PandocSomeError "Unknown file type" sizeSpec <- case imageSize imgdata of Left msg -> do - addWarning $ "Could not determine image size in `" ++ + warning $ "Could not determine image size in `" ++ src ++ "': " ++ msg return "" Right sz -> return $ "\\picw" ++ show xpx ++ @@ -78,17 +78,17 @@ rtfEmbedImage opts x@(Image attr _ (src,_)) = do concat bytes ++ "}" if B.null imgdata then do - addWarning $ "Image " ++ src ++ " contained no data, skipping." + warning $ "Image " ++ src ++ " contained no data, skipping." return x else return $ RawInline (Format "rtf") raw | otherwise -> do - addWarning $ "Image " ++ src ++ " is not a jpeg or png, skipping." + warning $ "Image " ++ src ++ " is not a jpeg or png, skipping." return x Right (_, Nothing) -> do - addWarning $ "Could not determine image type for " ++ src ++ ", skipping." + warning $ "Could not determine image type for " ++ src ++ ", skipping." return x Left e -> do - addWarning $ "Could not fetch image " ++ src ++ "\n" ++ show e + warning $ "Could not fetch image " ++ src ++ "\n" ++ show e return x rtfEmbedImage _ x = return x -- cgit v1.2.3