Leaguepedia | League of Legends Esports Wiki
Leaguepedia | League of Legends Esports Wiki

To edit the documentation or categories for this module, click here.

This module replaces the #replace parser function in the specific case that a reference is required in the replacement text; the parser function ignores references in this case, but the module will respect them.

Because {{ArgsUtil}}m.overwrite() is used, it's safe to call this function directly using #invoke without a special wrapping template.

Please escape any special characters using %.

local util_args = require('Module:ArgsUtil')

local h = {}

local p = {}
function p.main(frame)
	local args = util_args.original()
	if not args[2] then return args[1] end
	local replacement = args[1]:gsub(frame:preprocess(args[2]), args[3] or '')
	return replacement
return p