mirror of
https://github.com/cuberite/cuberite.git
synced 2025-01-07 03:16:55 +08:00
Added ability to echo HTML inside Lua logic blocks.
This commit is contained in:
parent
a41f74197c
commit
b7c3ad8096
@ -233,10 +233,14 @@ end
|
||||
local function CompileView(a_Content)
|
||||
content = 'return table.concat({[===[' .. a_Content .. ']===]})';
|
||||
content = content:gsub("%{=%{(.-)%}=%}", function(logic)
|
||||
logic = logic
|
||||
:gsub("<>(.-)</>", "table.insert(__RESULTING_CONTENT__, [===[%1]===])")
|
||||
:gsub("%{%{(.-)%}%}", "table.insert(__RESULTING_CONTENT__, cWebAdmin:GetHTMLEscapedString(%1))");
|
||||
|
||||
return [[]===], (
|
||||
function()
|
||||
local __RESULTING_CONTENT__ = {};
|
||||
]] .. logic:gsub("%{%{(.-)%}%}", "table.insert(__RESULTING_CONTENT__, cWebAdmin:GetHTMLEscapedString(%1))") .. [[
|
||||
]] .. logic .. [[
|
||||
return table.concat(__RESULTING_CONTENT__)
|
||||
end
|
||||
)(), [===[
|
||||
|
Loading…
Reference in New Issue
Block a user