Module:Link: Difference between revisions

From SPCodex, The Smashing Pumpkins wiki
No edit summary
No edit summary
Line 6: Line 6:
end
end


for _i, subject in { 'Billy Corgan', 'Butch Vig' } do
for _i, subject in ipairs({ 'Billy Corgan', 'Butch Vig' }) do
-- mw.ustring.gsub( content, subject, '[[:Category:Songs produced by ' .. subject .. '|' .. subject .. ']]' )
mw.ustring.gsub( content, subject, '[[:Category:Songs produced by ' .. subject .. '|' .. subject .. ']]' )
end
end



Revision as of 21:19, 17 April 2020

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

local str = {}

function str.producer( content )
	if content == '' then
		return content
	end

	for _i, subject in ipairs({ 'Billy Corgan', 'Butch Vig' }) do
		mw.ustring.gsub( content, subject, '[[:Category:Songs produced by ' .. subject .. '|' .. subject .. ']]' )
	end

	return content
end

return str