diff --git a/emphasis.lua b/emphasis.lua index f61646d..88e05a1 100644 --- a/emphasis.lua +++ b/emphasis.lua @@ -4,8 +4,14 @@ format.filter = function(text) for _, s in ipairs {"%*%*", "%_%_"} do text = text:gsub(s .. "([^%s][^<>]-[^%s][%*%_]?)" .. s, txtb("%1")); end; - for _, s in ipairs {"%*", "%_"} do + 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 diff --git a/rndstr.lua b/rndstr.lua new file mode 100644 index 0000000..6339763 --- /dev/null +++ b/rndstr.lua @@ -0,0 +1,3 @@ +rndstr = function(strings) + return strings[rnd(stead.table.maxn(strings))]; +end