Module:Resolve category redirect and Module:Resolve category redirect/sandbox: Difference between pages
(Difference between pages)
imported>Tom.Reding remove other params before evaluating, to avoid cases like Special:Diff/1245372095; +--; from sandbox |
imported>Tom.Reding 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:', '' ) -- | 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 |