---- NOTE: while I haven't looked through quite carefully enough, I think that ---- can do everything that this can do. I may put it up for deletion soon. ---- Sorry, this doesn't work for many applications because all templates are destroyed. It does work on plain text though.
---- This module is meant to be processed by putting ---- "" ---- into an existing page. Add "|pattern=yes" to enjoy all the wild and wooly ---- features of Lua pattern strings. This should deliver back all the text, ---- as modified, in wiki source form, for you to copy and paste back into the ---- page while editing. Caveat: I don't presently know if things like comments ---- will be lost. This is intended as a handy tool for editors who don't have ---- find and replace on their browser and don't want to open another program - ---- or to provide better Lua find and replace where their word processors come ---- up short. NOTE that text MUST be saved to be processed with this unless ---- you use an additional parameter |input=(the text to find and replace from)
local p =
function p.main(frame) local args=frame.args local parent=frame.getParent(frame) local pargs= if parent then pargs=parent.args end local find=args.find or pargs.find or args[1] or pargs[1] if not(find) then return "error you need to say what to find! (first unnamed parameter or find=(text)" end local replace=args.replace or pargs.replace or args[2] or pargs[2] or "" local pattern=args.pattern or pargs.pattern or "no" if pattern
nil or input