Archived
1
0
This repository has been archived on 2023-08-12. You can view files and clone it, but cannot push or open issues or pull requests.
nntpchan/contrib/lua/memeposting.lua
2017-01-28 15:12:00 -05:00

27 lines
553 B
Lua

-- simple replacements demo
function span_text(class, str)
return string.format("<div class='%s'>%s</div>", class, str)
end
function wobble_text(str)
return span_text("wobble", str)
end
function explode_text(str)
return span_text("explode", str)
end
function psy_text(str)
return span_text("psy", str)
end
-- generate extra markup
function memeposting(body, prefix)
body = string.gsub(body, "|(.-)|", wobble_text)
body = string.gsub(body, "//(.-)\\\\", explode_text)
body = string.gsub(body, "/@(.-)@\\", psy_text)
return body
end