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