mirror of
https://github.com/cuberite/cuberite.git
synced 2025-01-08 11:57:39 +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)
|
local function CompileView(a_Content)
|
||||||
content = 'return table.concat({[===[' .. a_Content .. ']===]})';
|
content = 'return table.concat({[===[' .. a_Content .. ']===]})';
|
||||||
content = content:gsub("%{=%{(.-)%}=%}", function(logic)
|
content = content:gsub("%{=%{(.-)%}=%}", function(logic)
|
||||||
|
logic = logic
|
||||||
|
:gsub("<>(.-)</>", "table.insert(__RESULTING_CONTENT__, [===[%1]===])")
|
||||||
|
:gsub("%{%{(.-)%}%}", "table.insert(__RESULTING_CONTENT__, cWebAdmin:GetHTMLEscapedString(%1))");
|
||||||
|
|
||||||
return [[]===], (
|
return [[]===], (
|
||||||
function()
|
function()
|
||||||
local __RESULTING_CONTENT__ = {};
|
local __RESULTING_CONTENT__ = {};
|
||||||
]] .. logic:gsub("%{%{(.-)%}%}", "table.insert(__RESULTING_CONTENT__, cWebAdmin:GetHTMLEscapedString(%1))") .. [[
|
]] .. logic .. [[
|
||||||
return table.concat(__RESULTING_CONTENT__)
|
return table.concat(__RESULTING_CONTENT__)
|
||||||
end
|
end
|
||||||
)(), [===[
|
)(), [===[
|
||||||
|
Loading…
Reference in New Issue
Block a user