Module:title/makeTitle: Difference between revisions

From Linguifex
Jump to navigation Jump to search
Remove internalOnly parameter, as it's just a simple key check and doesn't need special handling.
 
m 1 revision imported
 
(No difference)

Latest revision as of 11:21, 21 April 2026

Documentation for this module may be created at Module:title/makeTitle/doc

local make_title = mw.title.makeTitle

--[==[
A modified version of {mw.title.makeTitle} that fixes a bug which causes certain inputs to generate title objects for the empty string. 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]].]==]
return function(ns, title, fragment, interwiki)
	local title = make_title(ns, title, fragment, interwiki)
	return title and title.prefixedText ~= "" and title or nil
end