Просмотр кода страницы Модуль:Redirect
Внешний вид
У вас нет прав на выполнение действия «редактирование этой страницы» по следующей причине:
Вы можете просмотреть и скопировать исходный код этой страницы.
-- This module provides functions for getting the target of a redirect page.
local p = {}
-- Gets a mw.title object, using pcall to avoid generating script errors if we
-- are over the expensive function count limit (among other possible causes).
local function getTitle(...)
local success, titleObj = pcall(mw.title.new, ...)
if success then
return titleObj
else
return nil
end
end
-- Gets the name of a page that a redirect leads to, or nil if it isn't a
-- redirect.
function p.getTargetFromText(text)
local target = string.match(
text,
"^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]"
) or string.match(
000
1:0
Шаблон, используемый на этой странице:
Возврат к странице Модуль:Redirect.