From b7c3ad80966d3532468c40bd1d8355aa1841fae8 Mon Sep 17 00:00:00 2001 From: NiLSPACE Date: Sat, 17 Oct 2020 14:10:48 +0200 Subject: Added ability to echo HTML inside Lua logic blocks. --- Server/Plugins/InfoReg.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Server/Plugins/InfoReg.lua b/Server/Plugins/InfoReg.lua index 74e1196af..54cab4ab0 100644 --- a/Server/Plugins/InfoReg.lua +++ b/Server/Plugins/InfoReg.lua @@ -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 )(), [===[ -- cgit v1.2.3