steed/stead/dash.lua

11 lines
276 B
Lua
Raw Normal View History

2010-07-02 14:43:33 +03:00
stead.fmt = stead.hook(stead.fmt, function(f, ...)
local r = f(unpack(arg))
if game.codepage ~= 'UTF-8' then
error("You can not use dash module with non UTF-8 encoding.");
end
if type(r) == 'string' then
2010-07-02 14:57:52 +03:00
r = r:gsub('([^-])%-%-([^-])', '%1—%2');
2010-07-02 14:43:33 +03:00
end
return r;
end)