Emphasis update, rndstr module

This commit is contained in:
Alexander Yakovlev 2015-08-15 06:33:13 +07:00
parent 11da3d0598
commit 97b93c7213
2 changed files with 10 additions and 1 deletions

View file

@ -4,8 +4,14 @@ format.filter = function(text)
for _, s in ipairs {"%*%*", "%_%_"} do for _, s in ipairs {"%*%*", "%_%_"} do
text = text:gsub(s .. "([^%s][^<>]-[^%s][%*%_]?)" .. s, txtb("%1")); text = text:gsub(s .. "([^%s][^<>]-[^%s][%*%_]?)" .. s, txtb("%1"));
end; end;
for _, s in ipairs {"%*", "%_"} do for _, s in ipairs {"%*"} do
text = text:gsub(s .. "([^%s_][^<>_]-[^%s_])" .. s, txtem("%1")); text = text:gsub(s .. "([^%s_][^<>_]-[^%s_])" .. s, txtem("%1"));
end; end;
for _, s in ipairs {"%_"} do
text = text:gsub(s .. "([^%s_][^<>_]-[^%s_])" .. s, txtu("%1"));
end;
for _, s in ipairs {"%-"} do
text = text:gsub(s .. " ([^%s_][^<>_]-[^%s_]) " .. s, txtst("%1"));
end;
return text; return text;
end end

3
rndstr.lua Normal file
View file

@ -0,0 +1,3 @@
rndstr = function(strings)
return strings[rnd(stead.table.maxn(strings))];
end