Module:Redirect: Difference between revisions
handle redirects that pipe their link
(Moved from sandbox: making the isRedirect function available from other modules, like the main function is) |
(handle redirects that pipe their link) |
||
Line 19: | Line 19: | ||
return string.match( | return string.match( | ||
text, | text, | ||
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]]-)%]%]" | "^%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 | end |