Content deleted Content added
parsecaption(): return entire caption when no terminator found |
Sophivorus (talk | contribs) Remove dependency from Module:Redirect for easier porting to new wikis |
||
Line 59:
local p = {}
-- Get a redirect target (or nil if not a redirect) without using the expensive title object property .isRedirect
Line 65 ⟶ 64:
local content = titleObject:getContent()
if not content then return nil end
local target = 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*%[%[([^%[%]|]-)|[^%[%]]-%]%]"
)
return target
end
|