steed/stead/para.lua
2010-06-29 16:23:52 +00:00

13 lines
315 B
Lua

para_mod = {
space = ' ',
}
stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
if type(r) == 'string' and stead.state then
r = r:gsub('\n([^\n])', '<&para;>%1'):gsub('<&para;>[ \t]*', '\n'..txtnb(para_mod.space));
r = r:gsub('^[ \t]*',txtnb(para_mod.space))
end
return r;
end)