mirror of
https://github.com/TangentFoxy/lovebird.git
synced 2025-07-28 11:02:19 +00:00
Added lovebird.htmlescape() function
This commit is contained in:
11
lovebird.lua
11
lovebird.lua
@@ -158,7 +158,9 @@ end
|
|||||||
</html>
|
</html>
|
||||||
]]
|
]]
|
||||||
|
|
||||||
lovebird.pages["buffer"] = "<?lua echo(lovebird.buffer) ?>"
|
|
||||||
|
lovebird.pages["buffer"] = [[ <?lua echo(lovebird.buffer) ?> ]]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
local loadstring = loadstring or load
|
local loadstring = loadstring or load
|
||||||
@@ -229,10 +231,15 @@ function lovebird.parseurl(url)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function lovebird.htmlescape(str)
|
||||||
|
return str:gsub("<", "<")
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function lovebird.print(...)
|
function lovebird.print(...)
|
||||||
local str = table.concat(map({...}, tostring), " ")
|
local str = table.concat(map({...}, tostring), " ")
|
||||||
if not lovebird.allowhtml then
|
if not lovebird.allowhtml then
|
||||||
str = str:gsub("<", "<")
|
str = lovebird.htmlescape(str)
|
||||||
end
|
end
|
||||||
if lovebird.timestamp then
|
if lovebird.timestamp then
|
||||||
str = os.date('<span class="timestamp">[%H:%M:%S]</span> ') .. str
|
str = os.date('<span class="timestamp">[%H:%M:%S]</span> ') .. str
|
||||||
|
Reference in New Issue
Block a user