Added a bit to the template environment so all globals can now be called. (tenv._G refers to the regular global environment, so it's not safe from mangling, but that shouldn't matter either way. It allows much more freedom in writing templates.)

Originally committed to SVN as r1200.
This commit is contained in:
Niels Martin Hansen 2007-05-30 10:54:35 +00:00
parent 508d3d9a52
commit 59aad1f044
1 changed files with 3 additions and 1 deletions

View File

@ -248,8 +248,10 @@ function apply_templates(meta, styles, subs, templates)
local tenv = {
-- put in some standard libs
string = string,
math = math
math = math,
_G = _G
}
tenv.tenv = tenv
-- run all run-once code snippets
for k, t in pairs(templates.once) do