diff options
-rw-r--r-- | src/Text/Pandoc/PDF.hs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs index 516cc4002..4f232bf4f 100644 --- a/src/Text/Pandoc/PDF.hs +++ b/src/Text/Pandoc/PDF.hs @@ -27,6 +27,8 @@ import qualified Data.ByteString.Lazy.Char8 as BC import Data.Maybe (fromMaybe) import Data.Text (Text) import qualified Data.Text as T +import Text.Printf (printf) +import Data.Char (ord, isAscii) import System.Directory import System.Environment import System.Exit (ExitCode (..)) @@ -243,7 +245,12 @@ missingCharacterWarnings :: Verbosity -> ByteString -> PandocIO () missingCharacterWarnings verbosity log' = do let ls = BC.lines log' let isMissingCharacterWarning = BC.isPrefixOf "Missing character: " - let warnings = [ UTF8.toStringLazy (BC.drop 19 l) + let addCodePoint [] = [] + addCodePoint (c:cs) + | isAscii c = c : addCodePoint cs + | otherwise = c : " (U+" ++ printf "%04X" (ord c) ++ ")" ++ + addCodePoint cs + let warnings = [ addCodePoint (UTF8.toStringLazy (BC.drop 19 l)) | l <- ls , isMissingCharacterWarning l ] |