diff --git a/src/resources/pandoc/datadir/init.lua b/src/resources/pandoc/datadir/init.lua index 778402383c4..57da17d70b7 100644 --- a/src/resources/pandoc/datadir/init.lua +++ b/src/resources/pandoc/datadir/init.lua @@ -1,4 +1,4 @@ -if pandoc.system.os == "windows" then +if pandoc.system.os == "mingw32" then local function get_windows_ansi_codepage() -- Reading the code page directly out of the registry was causing diff --git a/tests/docs/smoke-all/2025/05/23/12806.qmd b/tests/docs/smoke-all/2025/05/23/12806.qmd new file mode 100644 index 00000000000..660c5226e95 --- /dev/null +++ b/tests/docs/smoke-all/2025/05/23/12806.qmd @@ -0,0 +1,12 @@ +--- +title: Checking init.lua defines codepage stuff on windows +format: native +_quarto: + tests: + native: default +filters: + - at: pre-ast + path: check-init.lua +--- + +This document only serve to run the Lua filter to check init.lua correctly applies on Windows \ No newline at end of file diff --git a/tests/docs/smoke-all/2025/05/23/check-init.lua b/tests/docs/smoke-all/2025/05/23/check-init.lua new file mode 100644 index 00000000000..2f87b88ed9a --- /dev/null +++ b/tests/docs/smoke-all/2025/05/23/check-init.lua @@ -0,0 +1,9 @@ +Meta = function(m) + if (pandoc.system.os == "mingw32") then + -- IMPORTANT: This is only valid on windows + assert(_G.convert_from_utf8, "Required function 'convert_from_utf8' is missing from global scope on Windows. Something may be wrong with 'init.lua'") + else + assert(not _G.convert_from_utf8, "Function 'convert_from_utf8' is in global scope on non-Windows. Something may be wrong with 'init.lua'") + end + return m +end \ No newline at end of file