From 5c6a8eb60799fa142640d5f64b8f312db85d5ea9 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Tue, 20 Feb 2024 20:39:43 +0100 Subject: Lua: avoid crashing when an error message is not valid UTF-8 Invalid input bytes in error messages caused pandoc to crash with an encoding exception. Instead, the invalid bytes are now replaced with the Unicode replacement character U+FFFD. --- pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pandoc-lua-engine/src/Text') diff --git a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs index 30389366c..f6d9d6e43 100644 --- a/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs +++ b/pandoc-lua-engine/src/Text/Pandoc/Lua/Marshal/PandocError.hs @@ -23,7 +23,7 @@ import HsLua.Packaging import Text.Pandoc.Error (PandocError (PandocLuaError), renderError) import qualified HsLua as Lua -import qualified Text.Pandoc.UTF8 as UTF8 +import qualified HsLua.Core.Utf8 as UTF8 -- | Lua userdata type definition for PandocError. typePandocError :: LuaError e => DocumentedType e PandocError -- cgit v1.2.3