<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="rue">
	<id>https://wiki.kocky.cc/w/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ARedirect</id>
	<title>Модуль:Redirect - Історія едітовань</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.kocky.cc/w/index.php?action=history&amp;feed=atom&amp;title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C%3ARedirect"/>
	<link rel="alternate" type="text/html" href="https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;action=history"/>
	<updated>2026-04-03T20:52:17Z</updated>
	<subtitle>Історія едітовань той сторінкы на вікі</subtitle>
	<generator>MediaWiki 1.40.1</generator>
	<entry>
		<id>https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=1045&amp;oldid=prev</id>
		<title>Бетярь: 1 ревізія: Plainlist from Wikipedia EN</title>
		<link rel="alternate" type="text/html" href="https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=1045&amp;oldid=prev"/>
		<updated>2024-02-17T19:36:24Z</updated>

		<summary type="html">&lt;p&gt;1 ревізія: Plainlist from Wikipedia EN&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;rue&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Старша верзія&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Ревізія 21:36, 17 фебруара 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;rue&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Не є роздїлне)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Бетярь</name></author>
	</entry>
	<entry>
		<id>https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=23&amp;oldid=prev</id>
		<title>Бетярь: Створена сторінка: -- 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...</title>
		<link rel="alternate" type="text/html" href="https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=23&amp;oldid=prev"/>
		<updated>2023-10-17T20:20:27Z</updated>

		<summary type="html">&lt;p&gt;Створена сторінка: -- 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...&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;rue&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Старша верзія&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Ревізія 22:20, 17 октовбра 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;rue&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Не є роздїлне)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Бетярь</name></author>
	</entry>
	<entry>
		<id>https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=1044&amp;oldid=prev</id>
		<title>en.wikipedia.org&gt;Johnuniq: restore p.getTargetFromText which is used by Module:RfD which is causing &quot;Lua error in Module:RfD at line 87: attempt to call upvalue &#039;getTargetFromText&#039; (a nil value)&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.kocky.cc/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Redirect&amp;diff=1044&amp;oldid=prev"/>
		<updated>2021-09-10T07:46:37Z</updated>

		<summary type="html">&lt;p&gt;restore p.getTargetFromText which is used by &lt;a href=&quot;/w/index.php?title=%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:RfD&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;Модуль:RfD (такой сторінкы нїт)&quot;&gt;Module:RfD&lt;/a&gt; which is causing &amp;quot;Lua error in Module:RfD at line 87: attempt to call upvalue &amp;#039;getTargetFromText&amp;#039; (a nil value)&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Нова сторінка&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module provides functions for getting the target of a redirect page.&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Gets a mw.title object, using pcall to avoid generating script errors if we&lt;br /&gt;
-- are over the expensive function count limit (among other possible causes).&lt;br /&gt;
local function getTitle(...)&lt;br /&gt;
	local success, titleObj = pcall(mw.title.new, ...)&lt;br /&gt;
	if success then&lt;br /&gt;
		return titleObj&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the name of a page that a redirect leads to, or nil if it isn&amp;#039;t a&lt;br /&gt;
-- redirect.&lt;br /&gt;
function p.getTargetFromText(text)&lt;br /&gt;
	local target = string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)%]%]&amp;quot;&lt;br /&gt;
	) or string.match(&lt;br /&gt;
		text,&lt;br /&gt;
		&amp;quot;^%s*#[Rr][Ee][Dd][Ii][Rr][Ee][Cc][Tt]%s*:?%s*%[%[([^%[%]|]-)|[^%[%]]-%]%]&amp;quot;&lt;br /&gt;
	)&lt;br /&gt;
	return target and mw.uri.decode(target, &amp;#039;PATH&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the target of a redirect. If the page specified is not a redirect,&lt;br /&gt;
-- returns nil.&lt;br /&gt;
function p.getTarget(page, fulltext)&lt;br /&gt;
	-- Get the title object. Both page names and title objects are allowed&lt;br /&gt;
	-- as input.&lt;br /&gt;
	local titleObj&lt;br /&gt;
	if type(page) == &amp;#039;string&amp;#039; or type(page) == &amp;#039;number&amp;#039; then&lt;br /&gt;
		titleObj = getTitle(page)&lt;br /&gt;
	elseif type(page) == &amp;#039;table&amp;#039; and type(page.getContent) == &amp;#039;function&amp;#039; then&lt;br /&gt;
		titleObj = page&lt;br /&gt;
	else&lt;br /&gt;
		error(string.format(&lt;br /&gt;
			&amp;quot;bad argument #1 to &amp;#039;getTarget&amp;#039;&amp;quot;&lt;br /&gt;
				.. &amp;quot; (string, number, or title object expected, got %s)&amp;quot;,&lt;br /&gt;
			type(page)&lt;br /&gt;
		), 2)&lt;br /&gt;
	end&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	local targetTitle = titleObj.redirectTarget&lt;br /&gt;
	if targetTitle then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			return targetTitle.fullText&lt;br /&gt;
		else&lt;br /&gt;
			return targetTitle.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
-- Given a single page name determines what page it redirects to and returns the&lt;br /&gt;
-- target page name, or the passed page name when not a redirect. The passed&lt;br /&gt;
-- page name can be given as plain text or as a page link.&lt;br /&gt;
--&lt;br /&gt;
-- Returns page name as plain text, or when the bracket parameter is given, as a&lt;br /&gt;
-- page link. Returns an error message when page does not exist or the redirect&lt;br /&gt;
-- target cannot be determined for some reason.&lt;br /&gt;
--]]&lt;br /&gt;
function p.luaMain(rname, bracket, fulltext)&lt;br /&gt;
	if type(rname) ~= &amp;quot;string&amp;quot; or not rname:find(&amp;quot;%S&amp;quot;) then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	bracket = bracket and &amp;quot;[[%s]]&amp;quot; or &amp;quot;%s&amp;quot;&lt;br /&gt;
	rname = rname:match(&amp;quot;%[%[(.+)%]%]&amp;quot;) or rname&lt;br /&gt;
	local target = p.getTarget(rname, fulltext)&lt;br /&gt;
	local ret = target or rname&lt;br /&gt;
	ret = getTitle(ret)&lt;br /&gt;
	if ret then&lt;br /&gt;
		if fulltext then&lt;br /&gt;
			ret = ret.fullText&lt;br /&gt;
		else&lt;br /&gt;
			ret = ret.prefixedText&lt;br /&gt;
		end&lt;br /&gt;
		return bracket:format(ret)&lt;br /&gt;
	else&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaMain function from wikitext.&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	return p.luaMain(args[1], args.bracket, args.fulltext) or &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Returns true if the specified page is a redirect, and false otherwise.&lt;br /&gt;
function p.luaIsRedirect(page)&lt;br /&gt;
	local titleObj = getTitle(page)&lt;br /&gt;
	if not titleObj then&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	if titleObj.isRedirect then&lt;br /&gt;
		return true&lt;br /&gt;
	else&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Provides access to the luaIsRedirect function from wikitext, returning &amp;#039;yes&amp;#039;&lt;br /&gt;
-- if the specified page is a redirect, and the blank string otherwise.&lt;br /&gt;
function p.isRedirect(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {frameOnly = true})&lt;br /&gt;
	if p.luaIsRedirect(args[1]) then&lt;br /&gt;
		return &amp;#039;yes&amp;#039;&lt;br /&gt;
	else&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>en.wikipedia.org&gt;Johnuniq</name></author>
	</entry>
</feed>