Halo Esports Wiki

We are currently performing extensive maintenance to this wiki and as a result there will likely be errors. Please be patient while we work to fix all problems.

READ MORE

Halo Esports Wiki
Advertisement

Documentation for this module may be created at Module:Description2/doc

local util_args = require('Module:ArgsUtil')
local util_text = require('Module:TextUtil')
local REPLACE = {
	{ find = "%[[^%]]*%|", replace = "[" },
	{ find = "['%[%]]", replace = '' },
	{ find = "<div.-</div>", replace = '' },
	{ find = '<span class="no-desc2".-</span>', replace = '' },
	{ find = '  ', replace = ' ' },
}

local p = {}
function p.main(frame)
	-- strips links & markup characters from standard bio sentence or custom text to be saved in metadesc via description2 extension
	local args = util_args.merge()
	local desc = args[1]
	if not desc then
		return
	end
	frame:callParserFunction{
		name = '#description2',
		args = util_text.escapeCustom(desc, REPLACE)
	}
end
return p
Advertisement