<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AIcon</id>
	<title>Module:Icon - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://themidnight.wiki/index.php?action=history&amp;feed=atom&amp;title=Module%3AIcon"/>
	<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Icon&amp;action=history"/>
	<updated>2026-04-03T20:56:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Icon&amp;diff=4751&amp;oldid=prev</id>
		<title>Timothy: 1 revision imported</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Icon&amp;diff=4751&amp;oldid=prev"/>
		<updated>2022-06-18T14:51:10Z</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 10:51, 18 June 2022&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>Timothy</name></author>
	</entry>
	<entry>
		<id>https://themidnight.wiki/index.php?title=Module:Icon&amp;diff=4750&amp;oldid=prev</id>
		<title>wikipedia&gt;Hike395: auto detect calls from sandbox</title>
		<link rel="alternate" type="text/html" href="https://themidnight.wiki/index.php?title=Module:Icon&amp;diff=4750&amp;oldid=prev"/>
		<updated>2022-02-12T18:06:28Z</updated>

		<summary type="html">&lt;p&gt;auto detect calls from sandbox&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;-- This module implements [[Template:Icon]].&lt;br /&gt;
&lt;br /&gt;
require(&amp;quot;Module:No globals&amp;quot;)&lt;br /&gt;
local yesNo = require(&amp;quot;Module:Yesno&amp;quot;)&lt;br /&gt;
local getArgs = require(&amp;quot;Module:Arguments&amp;quot;).getArgs&lt;br /&gt;
local getPlain = nil&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- Determine whether we&amp;#039;re being called from a sandbox&lt;br /&gt;
local sandbox = mw.getCurrentFrame():getTitle():find(&amp;#039;sandbox&amp;#039;, 1, true) and &amp;#039;/sandbox&amp;#039; or &amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
-- Implements [[Template:Icon]]&lt;br /&gt;
-- Returns the icon image corresponding to a string (like &amp;#039;B&amp;#039;)&lt;br /&gt;
function p._main(args, data)&lt;br /&gt;
	local data_module = &amp;#039;Module:Icon/data&amp;#039;..sandbox&lt;br /&gt;
	data = data or mw.loadData(data_module)&lt;br /&gt;
	local code = args.class or args[1]&lt;br /&gt;
	local iconData&lt;br /&gt;
	if code then&lt;br /&gt;
		code = code:match(&amp;#039;^%s*(.-)%s*$&amp;#039;):lower() -- trim whitespace and put in lower case&lt;br /&gt;
		iconData = data[code]&lt;br /&gt;
	end&lt;br /&gt;
	if not iconData then&lt;br /&gt;
		iconData = data._DEFAULT&lt;br /&gt;
	end&lt;br /&gt;
	return string.format(&lt;br /&gt;
		&amp;#039;[[File:%s%s%s|%s|class=noviewer|alt=%s]]&amp;#039;,&lt;br /&gt;
		iconData.image,&lt;br /&gt;
		iconData.tooltip and &amp;#039;|&amp;#039; .. iconData.tooltip or &amp;#039;&amp;#039;,&lt;br /&gt;
		iconData.link == false and &amp;#039;|link=&amp;#039; or &amp;#039;&amp;#039;,&lt;br /&gt;
		args.size or &amp;#039;16x16px&amp;#039;,&lt;br /&gt;
		iconData.alt or &amp;#039;&amp;#039;&lt;br /&gt;
	)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Implements [[Template:Icon link]], a superset of [[Template:Icon]]&lt;br /&gt;
-- Returns an icon, plus a suitably formatted wikilink&lt;br /&gt;
function p._link(args, data)&lt;br /&gt;
	args.size = args.size or args.iconsize&lt;br /&gt;
	local icon = p._main(args, data)&lt;br /&gt;
	-- If no link given in args[2], default back to [[Template:Icon]]&lt;br /&gt;
	if not args[2] then&lt;br /&gt;
		return icon&lt;br /&gt;
	end&lt;br /&gt;
	-- Strip wiki markup out of link&lt;br /&gt;
	getPlain = getPlain or require(&amp;quot;Module:Text&amp;quot;).Text().getPlain&lt;br /&gt;
	local link = getPlain(args[2])&lt;br /&gt;
	local display = args[3] or args[2]&lt;br /&gt;
	-- italicize display string, if requested&lt;br /&gt;
	if yesNo(args.i) or yesNo(args.italic) or yesNo(args.italics) then&lt;br /&gt;
		display = &amp;#039;&amp;lt;i&amp;gt;&amp;#039;..display..&amp;#039;&amp;lt;/i&amp;gt;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	-- if display is link, just use standard wlink&lt;br /&gt;
	if link == display then&lt;br /&gt;
		return icon..&amp;#039;&amp;amp;nbsp;[[&amp;#039;..link..&amp;#039;]]&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	return icon..&amp;#039;&amp;amp;nbsp;[[&amp;#039;..link..&amp;#039;|&amp;#039;..display..&amp;#039;]]&amp;#039;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = getArgs(frame,{parentFirst=true})&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.link(frame)&lt;br /&gt;
	local args = getArgs(frame,{parentFirst=true})&lt;br /&gt;
	return p._link(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>wikipedia&gt;Hike395</name></author>
	</entry>
</feed>