Skip to content

Commit e51e9ed

Browse files
committed
Fixed params.onAfterMeta() not using the returned value, if there was one.
1 parent 87704df commit e51e9ed

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

preprocess.lua

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1287,7 +1287,15 @@ local function _processFileOrString(params, isFile)
12871287
metaPathForErrorMessages = ""
12881288
outputFromMeta = nil
12891289

1290-
if params.onAfterMeta then params.onAfterMeta(lua) end
1290+
if params.onAfterMeta then
1291+
local luaModified = params.onAfterMeta(lua)
1292+
1293+
if type(luaModified) == "string" then
1294+
lua = luaModified
1295+
elseif luaModified ~= nil then
1296+
errorline("onAfterMeta() did not return a string. (Got "..type(luaModified)..")")
1297+
end
1298+
end
12911299

12921300
-- Write output file.
12931301
----------------------------------------------------------------

0 commit comments

Comments
 (0)