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" }
|
||||
|
||||
lovebird.inited = false
|
||||
lovebird.buffer = ""
|
||||
lovebird.lines = {}
|
||||
lovebird.host = "*"
|
||||
|
||||
lovebird.wrapprint = true
|
||||
lovebird.timestamp = true
|
||||
lovebird.allowhtml = true
|
||||
lovebird.port = 8000
|
||||
lovebird.whitelist = { "127.0.0.1", "localhost" }
|
||||
lovebird.maxlines = 200
|
||||
lovebird.refreshrate = .5
|
||||
lovebird.buffer = ""
|
||||
lovebird.lines = {}
|
||||
|
||||
lovebird.page = [[
|
||||
<!doctype html>
|
||||
@ -206,6 +208,9 @@ end
|
||||
|
||||
function lovebird.print(...)
|
||||
local str = table.concat(map({...}, tostring), " ")
|
||||
if not lovebird.allowhtml then
|
||||
str = str:gsub("<", "<")
|
||||
end
|
||||
if lovebird.timestamp then
|
||||
str = os.date('<span class="timestamp">[%H:%M:%S]</span> ') .. str
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user