diff --git a/stead/para.lua b/stead/para.lua index e640e80..fab4f04 100644 --- a/stead/para.lua +++ b/stead/para.lua @@ -6,7 +6,7 @@ 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])', '<¶>%1'):gsub('<¶>[ \t]*', '\n'..txtnb(para_mod.space)); - r = r:gsub('^',txtnb(para_mod.space)) + r = r:gsub('^[ \t]*',txtnb(para_mod.space)) end return r; end) diff --git a/stead/xact.lua b/stead/xact.lua index bcec3d5..710c6a1 100644 --- a/stead/xact.lua +++ b/stead/xact.lua @@ -110,15 +110,10 @@ end default_xdsc_obj = xdsc(); -xroom = stead.hook(room, function(f, v, ...) - if type(v) == 'table' then - if v.obj == nil then - v.obj = {} - elseif type(v.obj) ~= 'table' then - error("Wrong parameter to xroom.", 2); - end - -- we not use put here, to force saver do not save all list - stead.table.insert(v.obj, 1, 'default_xdsc_obj'); - end - return f(v, unpack(arg)) +xroom = stead.inherit(room, function(v) + v.look = stead.hook(v.look, function(f, s,...) + local xdsc = call(s, 'xdsc'); + return par(' ', xdsc, f(s, unpack(arg))); + end) + return v end)