<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Atitle%2FnewTitle</id>
	<title>Module:title/newTitle - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://linguifex.com/w/index.php?action=history&amp;feed=atom&amp;title=Module%3Atitle%2FnewTitle"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;action=history"/>
	<updated>2026-04-05T23:26:50Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=474951&amp;oldid=prev</id>
		<title>Sware: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=474951&amp;oldid=prev"/>
		<updated>2025-11-04T17:47:25Z</updated>

		<summary type="html">&lt;p&gt;1 revision imported&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 17:47, 4 November 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=459867&amp;oldid=prev</id>
		<title>Sware: Created page with &quot;local load_module = &quot;Module:load&quot; local scribunto_module = &quot;Module:Scribunto&quot; local title_get_current_namespace_module = &quot;Module:title/getCurrentNamespace&quot; local title_get_current_title_module = &quot;Module:title/getCurrentTitle&quot; local title_get_main_page_title_module = &quot;Module:title/getMainPageTitle&quot;  local byte = string.byte local find = string.find local match = string.match local new_title = mw.title.new local reverse = string.reverse local sub = string.sub local type =...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=459867&amp;oldid=prev"/>
		<updated>2025-06-28T09:11:42Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local load_module = &amp;quot;Module:load&amp;quot; local scribunto_module = &amp;quot;Module:Scribunto&amp;quot; local title_get_current_namespace_module = &amp;quot;Module:title/getCurrentNamespace&amp;quot; local title_get_current_title_module = &amp;quot;Module:title/getCurrentTitle&amp;quot; local title_get_main_page_title_module = &amp;quot;Module:title/getMainPageTitle&amp;quot;  local byte = string.byte local find = string.find local match = string.match local new_title = mw.title.new local reverse = string.reverse local sub = string.sub local type =...&amp;quot;&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;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 09:11, 28 June 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Sware</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=474950&amp;oldid=prev</id>
		<title>wikt&gt;Theknightwho at 20:03, 27 May 2025</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:title/newTitle&amp;diff=474950&amp;oldid=prev"/>
		<updated>2025-05-27T20:03:25Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local load_module = &amp;quot;Module:load&amp;quot;&lt;br /&gt;
local scribunto_module = &amp;quot;Module:Scribunto&amp;quot;&lt;br /&gt;
local title_get_current_namespace_module = &amp;quot;Module:title/getCurrentNamespace&amp;quot;&lt;br /&gt;
local title_get_current_title_module = &amp;quot;Module:title/getCurrentTitle&amp;quot;&lt;br /&gt;
local title_get_main_page_title_module = &amp;quot;Module:title/getMainPageTitle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
local byte = string.byte&lt;br /&gt;
local find = string.find&lt;br /&gt;
local match = string.match&lt;br /&gt;
local new_title = mw.title.new&lt;br /&gt;
local reverse = string.reverse&lt;br /&gt;
local sub = string.sub&lt;br /&gt;
local type = type&lt;br /&gt;
&lt;br /&gt;
local function get_current_title(...)&lt;br /&gt;
	get_current_title = require(title_get_current_title_module)&lt;br /&gt;
	return get_current_title(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function get_main_page_title(...)&lt;br /&gt;
	get_main_page_title = require(title_get_main_page_title_module)&lt;br /&gt;
	return get_main_page_title(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function php_ltrim(...)&lt;br /&gt;
	php_ltrim = require(scribunto_module).php_ltrim&lt;br /&gt;
	return php_ltrim(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function php_rtrim(...)&lt;br /&gt;
	php_rtrim = require(scribunto_module).php_rtrim&lt;br /&gt;
	return php_rtrim(...)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local current_pagename&lt;br /&gt;
local function get_current_pagename()&lt;br /&gt;
	-- Call mw.title.getCurrentTitle() directly rather than the modified version&lt;br /&gt;
	-- at [[Module:title/getCurrentTitle]], as it doesn&amp;#039;t do anything extra when&lt;br /&gt;
	-- no fragment argument is given, so there&amp;#039;s no point in loading it.&lt;br /&gt;
	current_pagename, get_current_pagename = mw.title.getCurrentTitle().prefixedText, nil&lt;br /&gt;
	return current_pagename&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local namespace_has_subpages&lt;br /&gt;
local function get_namespace_has_subpages()&lt;br /&gt;
	namespace_has_subpages, get_namespace_has_subpages = require(load_module).load_data(title_get_current_namespace_module).hasSubpages, nil&lt;br /&gt;
	return namespace_has_subpages&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function split_text(text)&lt;br /&gt;
	-- Split off the fragment.&lt;br /&gt;
	local hash, target, fragment = find(text, &amp;quot;#&amp;quot;, nil, true)&lt;br /&gt;
	if hash then&lt;br /&gt;
		target, fragment = sub(text, 1, hash - 1), sub(text, hash)&lt;br /&gt;
	else&lt;br /&gt;
		target, fragment = text, &amp;quot;&amp;quot;&lt;br /&gt;
	end&lt;br /&gt;
	return php_rtrim(target), fragment&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[==[&lt;br /&gt;
A modified version of {mw.title.new}:&lt;br /&gt;
* It is no longer possible to generate title objects for the empty string by inputting a title starting with {&amp;quot;#&amp;quot;}. Such empty string titles do not represent a valid page, and are broken in various ways (e.g. attempting to access certain keys results in an error); see [[phab:T240678]].&lt;br /&gt;
* There are two additional boolean flags:&lt;br /&gt;
** If {allowOnlyFragment} is set, string inputs starting with {#} are handled analogously to links (e.g. the input {&amp;quot;#foo&amp;quot;} returns a title object for the current page with the addition of the fragment {&amp;quot;foo&amp;quot;}, analogous to the link [[#foo]]). As a special case, the input {&amp;quot;#&amp;quot;} returns the title for the main page (see TitleValue.php).&lt;br /&gt;
** If {allowRelative} is set, inputs representing relative titles will work (e.g. {&amp;quot;/foo&amp;quot;} and {&amp;quot;../&amp;quot;}, analogous to the relative links [[/foo]] and [[../]]).]==]&lt;br /&gt;
return function(text_or_id, defaultNamespace, allowOnlyFragment, allowRelative)&lt;br /&gt;
	-- Process relative titles in the same way as normalizeSubpageLink() in&lt;br /&gt;
	-- Linker.php.&lt;br /&gt;
	if (&lt;br /&gt;
		allowRelative and&lt;br /&gt;
		type(text_or_id) == &amp;quot;string&amp;quot; and&lt;br /&gt;
		-- Distinguish nil and false for the purposes of calling the getter.&lt;br /&gt;
		(namespace_has_subpages == nil and get_namespace_has_subpages() or namespace_has_subpages)&lt;br /&gt;
	) then&lt;br /&gt;
		-- For both kinds of relative title, `text_or_id` has to be split into&lt;br /&gt;
		-- `target` and `fragment` (if any). `target` has to be trimmed, but&lt;br /&gt;
		-- as an optimisation, only do a left-trim on `text_or_id`, which is&lt;br /&gt;
		-- sufficient for the initial checks for potential relative titles, as&lt;br /&gt;
		-- this avoids unnecessary splitting/trimming in the vast majority of&lt;br /&gt;
		-- cases where the title won&amp;#039;t be relative. In the cases where it is,&lt;br /&gt;
		-- `target` will then be right-trimmed once it has been split out of&lt;br /&gt;
		-- `text_or_id`.&lt;br /&gt;
		text_or_id = php_ltrim(text_or_id)&lt;br /&gt;
		local init = byte(text_or_id)&lt;br /&gt;
		-- If the target starts with &amp;quot;/&amp;quot;, it&amp;#039;s treated as a subpage of the&lt;br /&gt;
		-- current page. Final slashes are trimmed, but this can&amp;#039;t affect the&lt;br /&gt;
		-- intervening slash (e.g. &amp;quot;[[///]]&amp;quot; refers to &amp;quot;[[{{PAGENAME}}/]]&amp;quot;).&lt;br /&gt;
		if init == 0x2F then -- /&lt;br /&gt;
			local target, fragment = split_text(text_or_id)&lt;br /&gt;
			text_or_id, defaultNamespace = (current_pagename or get_current_pagename()) .. (match(target, &amp;quot;^/.*[^/]&amp;quot;) or &amp;quot;/&amp;quot;) .. fragment, nil&lt;br /&gt;
		-- If the title starts with &amp;quot;../&amp;quot;, trim it and any further &amp;quot;../&amp;quot; that&lt;br /&gt;
		-- follow, and go up that many subpage levels. Then, treat any&lt;br /&gt;
		-- additional text as a subpage of that page. Final slashes are trimmed.&lt;br /&gt;
		elseif init == 0x2E and sub(text_or_id, 2, 3) == &amp;quot;./&amp;quot; then -- ../&lt;br /&gt;
			local n, target, fragment = 4, split_text(text_or_id)&lt;br /&gt;
			while sub(target, n, n + 2) == &amp;quot;../&amp;quot; do&lt;br /&gt;
				n = n + 3&lt;br /&gt;
			end&lt;br /&gt;
			-- Retain an initial &amp;quot;/&amp;quot;.&lt;br /&gt;
			target = sub(target, n - 1)&lt;br /&gt;
			-- Trim the relevant number of subpages from the pagename.&lt;br /&gt;
			local pagename, i = reverse(current_pagename or get_current_pagename()), 0&lt;br /&gt;
			for _ = 1, (n - 1) / 3 do&lt;br /&gt;
				i = find(pagename, &amp;quot;/&amp;quot;, i + 1, true)&lt;br /&gt;
				-- Fail if there aren&amp;#039;t enough slashes.&lt;br /&gt;
				if not i then&lt;br /&gt;
					return nil&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			-- Add the subpage text; since the intervening &amp;quot;/&amp;quot; is retained in&lt;br /&gt;
			-- `target`, it can be trimmed along with any other final slashes&lt;br /&gt;
			-- (e.g. [[..///]] refers to &amp;quot;{{BASEPAGENAME}}&amp;quot;.)&lt;br /&gt;
			text_or_id, defaultNamespace = reverse(sub(pagename, i + 1)) .. (match(target, &amp;quot;^.*[^/]&amp;quot;) or &amp;quot;&amp;quot;) .. fragment, nil&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	local title = new_title(text_or_id, defaultNamespace)&lt;br /&gt;
	if not title then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif title.prefixedText ~= &amp;quot;&amp;quot; then&lt;br /&gt;
		return title&lt;br /&gt;
	-- If `prefixedText` is the empty string, the input only has a fragment.&lt;br /&gt;
	elseif not allowOnlyFragment then&lt;br /&gt;
		return nil&lt;br /&gt;
	end&lt;br /&gt;
	-- Retrieve the fragment: if it&amp;#039;s the empty string, return a title object&lt;br /&gt;
	-- for the main page (which is where the link [[#]] resolves); otherwise,&lt;br /&gt;
	-- return a current title object using [[Module:title/getCurrentTitle]],&lt;br /&gt;
	-- which sets the fragment on the returned title to the string passed in.&lt;br /&gt;
	-- (Note that inputs like &amp;quot;##foo&amp;quot; aren&amp;#039;t interpreted as the main page with&lt;br /&gt;
	-- the fragment &amp;quot;foo&amp;quot;; instead, it&amp;#039;s a fragment for the section &amp;quot;#foo&amp;quot; on&lt;br /&gt;
	-- the current page, since &amp;quot;#&amp;quot; is itself a valid fragment character.)&lt;br /&gt;
	local fragment = title.fragment&lt;br /&gt;
	return fragment == &amp;quot;&amp;quot; and get_main_page_title() or get_current_title(fragment)&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>wikt&gt;Theknightwho</name></author>
	</entry>
</feed>