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