<?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%3ACheck_for_unknown_parameters</id>
	<title>Module:Check for unknown parameters - 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%3ACheck_for_unknown_parameters"/>
	<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Check_for_unknown_parameters&amp;action=history"/>
	<updated>2026-04-03T22:17: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:Check_for_unknown_parameters&amp;diff=477390&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:Check_for_unknown_parameters&amp;diff=477390&amp;oldid=prev"/>
		<updated>2025-11-15T11:43:53Z</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 11:43, 15 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:Check_for_unknown_parameters&amp;diff=477389&amp;oldid=prev</id>
		<title>w&gt;Joy: document missing mapframe parameter aliases</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Check_for_unknown_parameters&amp;diff=477389&amp;oldid=prev"/>
		<updated>2025-10-17T11:01:38Z</updated>

		<summary type="html">&lt;p&gt;document missing mapframe parameter aliases&lt;/p&gt;
&lt;a href=&quot;https://linguifex.com/w/index.php?title=Module:Check_for_unknown_parameters&amp;amp;diff=477389&amp;amp;oldid=96887&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>w&gt;Joy</name></author>
	</entry>
	<entry>
		<id>https://linguifex.com/w/index.php?title=Module:Check_for_unknown_parameters&amp;diff=96887&amp;oldid=prev</id>
		<title>Chrysophylax: Created page with &quot;-- This module may be used to compare the arguments passed to the parent -- with a list of arguments, returning a specified result if an argument is -- not on the list local p...&quot;</title>
		<link rel="alternate" type="text/html" href="https://linguifex.com/w/index.php?title=Module:Check_for_unknown_parameters&amp;diff=96887&amp;oldid=prev"/>
		<updated>2018-01-05T22:54:43Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;-- This module may be used to compare the arguments passed to the parent -- with a list of arguments, returning a specified result if an argument is -- not on the list local p...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module may be used to compare the arguments passed to the parent&lt;br /&gt;
-- with a list of arguments, returning a specified result if an argument is&lt;br /&gt;
-- not on the list&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
local function trim(s)&lt;br /&gt;
	return s:match(&amp;#039;^%s*(.-)%s*$&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
local function isnotempty(s)&lt;br /&gt;
	return s and trim(s) ~= &amp;#039;&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.check (frame)&lt;br /&gt;
	local args = frame.args&lt;br /&gt;
	local pargs = frame:getParent().args&lt;br /&gt;
	local ignoreblank = isnotempty(frame.args[&amp;#039;ignoreblank&amp;#039;])&lt;br /&gt;
	local showblankpos = isnotempty(frame.args[&amp;#039;showblankpositional&amp;#039;])&lt;br /&gt;
	local knownargs = {}&lt;br /&gt;
	local unknown = frame.args[&amp;#039;unknown&amp;#039;] or &amp;#039;Found _VALUE_, &amp;#039;&lt;br /&gt;
	local preview = frame.args[&amp;#039;preview&amp;#039;]&lt;br /&gt;
&lt;br /&gt;
	local values = {}&lt;br /&gt;
	local res = {}&lt;br /&gt;
	local regexps = {}&lt;br /&gt;
&lt;br /&gt;
	-- create the list of known args, regular expressions, and the return string&lt;br /&gt;
	for k, v in pairs(args) do&lt;br /&gt;
		if type(k) == &amp;#039;number&amp;#039; then&lt;br /&gt;
			v = trim(v)&lt;br /&gt;
			knownargs[v] = 1&lt;br /&gt;
		elseif k:find(&amp;#039;^regexp[1-9][0-9]*$&amp;#039;) then&lt;br /&gt;
			table.insert(regexps, &amp;#039;^&amp;#039; .. v .. &amp;#039;$&amp;#039;)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	if isnotempty(preview) then &lt;br /&gt;
		preview = &amp;#039;&amp;lt;div class=&amp;quot;hatnote&amp;quot; style=&amp;quot;color:red&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Warning:&amp;lt;/strong&amp;gt; &amp;#039; .. preview .. &amp;#039; (this message is shown only in preview).&amp;lt;/div&amp;gt;&amp;#039;&lt;br /&gt;
	elseif preview == nil then&lt;br /&gt;
		preview = unknown&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- loop over the parent args, and make sure they are on the list&lt;br /&gt;
	for k, v in pairs(pargs) do&lt;br /&gt;
		if type(k) == &amp;#039;string&amp;#039; and knownargs[k] == nil then&lt;br /&gt;
			local knownflag = false&lt;br /&gt;
			for i, regexp in ipairs(regexps) do&lt;br /&gt;
				if mw.ustring.match(k, regexp) then&lt;br /&gt;
					knownflag = true&lt;br /&gt;
					break&lt;br /&gt;
				end&lt;br /&gt;
			end&lt;br /&gt;
			if not knownflag and ( not ignoreblank or isnotempty(v) )  then&lt;br /&gt;
				k = mw.ustring.gsub(k, &amp;#039;[^%w\-_ ]&amp;#039;, &amp;#039;?&amp;#039;)&lt;br /&gt;
				table.insert(values, k)&lt;br /&gt;
			end&lt;br /&gt;
		elseif type(k) == &amp;#039;number&amp;#039; and &lt;br /&gt;
			knownargs[tostring(k)] == nil and&lt;br /&gt;
			( showblankpos or isnotempty(v) )&lt;br /&gt;
		then&lt;br /&gt;
			local vlen = mw.ustring.len(v)&lt;br /&gt;
			v = mw.ustring.sub(v, 1, (vlen &amp;lt; 25) and vlen or 25) &lt;br /&gt;
			v = mw.ustring.gsub(v, &amp;#039;[^%w\-_ ]&amp;#039;, &amp;#039;?&amp;#039;)&lt;br /&gt;
			table.insert(values, k .. &amp;#039; = &amp;#039; .. v .. ((vlen &amp;gt;= 25) and &amp;#039; ...&amp;#039; or &amp;#039;&amp;#039;))&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	-- add resuls to the output tables&lt;br /&gt;
	if #values &amp;gt; 0 then&lt;br /&gt;
		if frame:preprocess( &amp;quot;{{REVISIONID}}&amp;quot; ) == &amp;quot;&amp;quot; then&lt;br /&gt;
			unknown = preview&lt;br /&gt;
		end&lt;br /&gt;
		for k, v in pairs(values) do&lt;br /&gt;
			if v == &amp;#039;&amp;#039; then&lt;br /&gt;
			-- Fix odd bug for | = which gets stripped to the empty string and&lt;br /&gt;
			-- breaks category links&lt;br /&gt;
			v = &amp;#039; &amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			local r =  unknown:gsub(&amp;#039;_VALUE_&amp;#039;, v)&lt;br /&gt;
			table.insert(res, r)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return table.concat(res)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Chrysophylax</name></author>
	</entry>
</feed>