steed/stead/para.lua

13 lines
309 B
Lua
Raw Normal View History

2010-06-24 12:33:59 +03:00
para_mod = {
2010-06-23 20:34:46 +03:00
space = ' ',
2010-06-23 17:15:29 +03:00
}
2010-06-23 15:09:33 +03:00
stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
2010-06-24 12:33:59 +03:00
if type(r) == 'string' and stead.state then
2010-06-23 20:34:46 +03:00
r = r:gsub('\n([^\n])', '<&para;>%1'):gsub('<&para;>[ \t]*', '\n'..txtnb(para_mod.space));
r = r:gsub('^',txtnb(para_mod.space))
end
return r;
end)