"ഘടകം:Redirect" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
117.207.169.75 (സംവാദം) ചെയ്ത നാൾപ്പതിപ്പ് 2192144 നീക്കം ചെയ്യുന്നു
handle redirects that pipe their link
വരി 19:
return string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
end
Line 95 ⟶ 98:
end
 
-- Returns "yes"true if the specified page is a redirect, and the blankfalse stringotherwise.
function p.isRedirectluaIsRedirect(framepage)
-- otherwise.
local titleObj = getTitle(args[1]page)
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
local titleObj = getTitle(args[1])
if not titleObj then
return ''false
end
if titleObj.isRedirect then
return true
else
return false
end
end
 
-- Provides access to the luaIsRedirect function from wikitext, returning 'yes'
-- if the specified page is a redirect, and the blank string otherwise.
function p.isRedirect(frame)
local args = require('Module:Arguments').getArgs(frame, {frameOnly = true})
if p.luaIsRedirect(args[1]) then
return 'yes'
else
"https://ml.wikipedia.org/wiki/ഘടകം:Redirect" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്