Jump to content

Module:Resolve category redirect and Module:Resolve category redirect/sandbox: Difference between pages

(Difference between pages)
Page 1
Page 2
Content deleted Content added
remove other params before evaluating, to avoid cases like Special:Diff/1245372095; +--; from sandbox
 
m dang
 
Line 10: Line 10:
--Returns the target of {{Category redirect}}, if it exists, else returns the original cat.
--Returns the target of {{Category redirect}}, if it exists, else returns the original cat.
function p.rtarget( cat, frame )
function p.rtarget( cat, frame )
cat = string.gsub( cat, '^[Cc]ategory:', '' ) --"!" in cat not recognized by mw.title.makeTitle() otherwise
cat = string.gsub( cat, '^[Cc]ategory:', '' ) --'!' in cat not recognized by mw.title.makeTitle() otherwise
if string.match( cat, '[|]' ) then
if string.match( cat, '[|]' ) then
return cat
return cat