mirror of
https://github.com/rxi/lovebird.git
synced 2024-11-27 12:04:21 +00:00
Added lovebird.allowhtml option and functionality
This commit is contained in:
parent
df1fcaf9f6
commit
4ffe4920e6
@ -12,15 +12,17 @@ local socket = require "socket"
|
|||||||
local lovebird = { _version = "0.0.1" }
|
local lovebird = { _version = "0.0.1" }
|
||||||
|
|
||||||
lovebird.inited = false
|
lovebird.inited = false
|
||||||
|
lovebird.buffer = ""
|
||||||
|
lovebird.lines = {}
|
||||||
lovebird.host = "*"
|
lovebird.host = "*"
|
||||||
|
|
||||||
lovebird.wrapprint = true
|
lovebird.wrapprint = true
|
||||||
lovebird.timestamp = true
|
lovebird.timestamp = true
|
||||||
|
lovebird.allowhtml = true
|
||||||
lovebird.port = 8000
|
lovebird.port = 8000
|
||||||
lovebird.whitelist = { "127.0.0.1", "localhost" }
|
lovebird.whitelist = { "127.0.0.1", "localhost" }
|
||||||
lovebird.maxlines = 200
|
lovebird.maxlines = 200
|
||||||
lovebird.refreshrate = .5
|
lovebird.refreshrate = .5
|
||||||
lovebird.buffer = ""
|
|
||||||
lovebird.lines = {}
|
|
||||||
|
|
||||||
lovebird.page = [[
|
lovebird.page = [[
|
||||||
<!doctype html>
|
<!doctype html>
|
||||||
@ -206,6 +208,9 @@ end
|
|||||||
|
|
||||||
function lovebird.print(...)
|
function lovebird.print(...)
|
||||||
local str = table.concat(map({...}, tostring), " ")
|
local str = table.concat(map({...}, tostring), " ")
|
||||||
|
if not lovebird.allowhtml then
|
||||||
|
str = str:gsub("<", "<")
|
||||||
|
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
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user