You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
514 B
18 lines
514 B
6 years ago
|
require 'format'
|
||
|
|
||
|
format.filter = function(text)
|
||
|
for _, s in ipairs {"%*%*", "%_%_"} do
|
||
|
text = text:gsub(s .. "([^%s][^<>]-[^%s][%*%_]?)" .. s, txtb("%1"));
|
||
|
end;
|
||
|
for _, s in ipairs {"%*"} do
|
||
|
text = text:gsub(s .. "([^%s_][^<>_]-[^%s_])" .. s, txtem("%1"));
|
||
|
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;
|
||
|
end
|