Skip to content

Commit

Permalink
Always log warnings to stderr
Browse files Browse the repository at this point in the history
It seems that pandoc's `warn` function is buggy, so we use a custom one.
  • Loading branch information
tarleb committed May 20, 2024
1 parent 1c057a3 commit ad40f6e
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions _extensions/diagram/diagram.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ See copyright notice in file LICENSE.
-- The filter uses the Figure AST element, which was added in pandoc 3.
PANDOC_VERSION:must_be_at_least '3.0'

-- Report Lua warnings to stderr
if warn then
warn '@on'
else
warn = function(...) io.stderr:write(table.concat({ ... })) end
end
-- Always report Lua warnings to stderr. It would be preferable to use the
-- default `warn` function that's plugged into pandoc's logging system, but it
-- appears to be buggy.
warn = function(...) io.stderr:write(table.concat({ ... })) end

local system = require 'pandoc.system'
local utils = require 'pandoc.utils'
Expand Down

0 comments on commit ad40f6e

Please sign in to comment.