1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
local buffer
function filter_open(...)
buffer = ""
end
function filter_write(str)
buffer = buffer .. str
end
function filter_close()
local out = buffer:gsub("%f[%w](%x+)%f[%W]", function(hex)
if #hex >= 7 and #hex <= 64 then
return '<a href="./?id=' .. hex .. '">' .. hex .. '</a>'
end
end)
out = out:gsub("#(%d+)", '<a href="https://bugs.example.com/?bug=%1">#%1</a>')
html(out)
return 0
end
|