Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/resources/pandoc/datadir/init.lua
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 12 additions & 0 deletions tests/docs/smoke-all/2025/05/23/12806.qmd
Original file line number Diff line number Diff line change
@@ -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
9 changes: 9 additions & 0 deletions tests/docs/smoke-all/2025/05/23/check-init.lua
Original file line number Diff line number Diff line change
@@ -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
Loading