<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hna.wiki/Module:Item?action=history&amp;feed=atom</id>
	<title>Module:Item - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hna.wiki/Module:Item?action=history&amp;feed=atom"/>
	<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Item?action=history"/>
	<updated>2026-07-14T21:48:30Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.46.0</generator>
	<entry>
		<id>https://hna.wiki/Module:Item?diff=1645&amp;oldid=prev</id>
		<title>ReinDevildom: Created page with &quot;local p = {} local lib = require(&#039;Module:Feature&#039;)  function p.main(frame) 	local args = require(&#039;Module:Arguments&#039;).getArgs(frame, { 		parentFirst = true, 		removeBlanks = false 	}) 	return p._main(args) end  function p._main(args) 	local item		= lib.nilIfEmpty(args[1])		or lib.nilIfEmpty(args.name)	or &#039;Unknown&#039; 	local size		= lib.nilIfEmpty(args[2])		or lib.nilIfEmpty(args.size)	or 30 	local count		= lib.nilIfEmpty(args.count)	or lib.nilIfEmpty(args.x)		or nil 	local n...&quot;</title>
		<link rel="alternate" type="text/html" href="https://hna.wiki/Module:Item?diff=1645&amp;oldid=prev"/>
		<updated>2025-08-30T13:51:00Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;local p = {} local lib = require(&amp;#039;Module:Feature&amp;#039;)  function p.main(frame) 	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, { 		parentFirst = true, 		removeBlanks = false 	}) 	return p._main(args) end  function p._main(args) 	local item		= lib.nilIfEmpty(args[1])		or lib.nilIfEmpty(args.name)	or &amp;#039;Unknown&amp;#039; 	local size		= lib.nilIfEmpty(args[2])		or lib.nilIfEmpty(args.size)	or 30 	local count		= lib.nilIfEmpty(args.count)	or lib.nilIfEmpty(args.x)		or nil 	local n...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local p = {}&lt;br /&gt;
local lib = require(&amp;#039;Module:Feature&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
function p.main(frame)&lt;br /&gt;
	local args = require(&amp;#039;Module:Arguments&amp;#039;).getArgs(frame, {&lt;br /&gt;
		parentFirst = true,&lt;br /&gt;
		removeBlanks = false&lt;br /&gt;
	})&lt;br /&gt;
	return p._main(args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p._main(args)&lt;br /&gt;
	local item		= lib.nilIfEmpty(args[1])		or lib.nilIfEmpty(args.name)	or &amp;#039;Unknown&amp;#039;&lt;br /&gt;
	local size		= lib.nilIfEmpty(args[2])		or lib.nilIfEmpty(args.size)	or 30&lt;br /&gt;
	local count		= lib.nilIfEmpty(args.count)	or lib.nilIfEmpty(args.x)		or nil&lt;br /&gt;
	local note		= lib.nilIfEmpty(args.note)		or nil&lt;br /&gt;
	local ref		= lib.nilIfEmpty(args.ref)		or nil&lt;br /&gt;
	local type		= lib.nilIfEmpty(args[&amp;#039;type&amp;#039;])	or &amp;#039;Item&amp;#039;&lt;br /&gt;
	local text		= lib.nilIfEmpty(args.text)		or item&lt;br /&gt;
	local link		= args.link						or lib.ternary(item == &amp;#039;Unknown&amp;#039;, &amp;#039;&amp;#039;, item)&lt;br /&gt;
	local blueprint	= tostring(args.blueprint) == &amp;#039;1&amp;#039;&lt;br /&gt;
	local newline	= tostring(args.newline) == &amp;#039;1&amp;#039;&lt;br /&gt;
	local notext	= tostring(args.notext) == &amp;#039;1&amp;#039;&lt;br /&gt;
	local white		= tostring(args.white) == &amp;#039;1&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	local prefix	= args.prefix and (args.prefix .. &amp;#039; &amp;#039;) or (type .. &amp;#039; &amp;#039;)&lt;br /&gt;
	local suffix	= args.suffix and (&amp;#039; &amp;#039; .. args.suffix) or &amp;#039;&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	if lib.inArray({&amp;#039;Character&amp;#039;}, type) then&lt;br /&gt;
		prefix = &amp;#039;&amp;#039;&lt;br /&gt;
		suffix = &amp;#039; Character Icon&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if lib.inArray({&amp;#039;Anima&amp;#039;}, type) then&lt;br /&gt;
		prefix = &amp;#039;&amp;#039;&lt;br /&gt;
		suffix = &amp;#039; Anima Icon&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (type ~= &amp;#039;Character&amp;#039; and item == &amp;#039;Unknown&amp;#039;) then&lt;br /&gt;
		prefix = &amp;#039;&amp;#039;&lt;br /&gt;
		suffix = &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (white) then suffix = suffix .. &amp;#039; White&amp;#039; end&lt;br /&gt;
	&lt;br /&gt;
	local filename = &amp;#039;File:&amp;#039; .. prefix .. item .. suffix .. &amp;#039;.png&amp;#039;&lt;br /&gt;
	&lt;br /&gt;
	local file = &amp;#039;[[&amp;#039; .. filename .. &amp;#039;|&amp;#039; .. size .. &amp;#039;x&amp;#039; .. size .. &amp;#039;px|alt=&amp;#039; .. item .. &amp;#039;|link=&amp;#039; .. link .. &amp;#039;]]&amp;#039;&lt;br /&gt;
	local mobile_file = &amp;#039;[[&amp;#039; .. filename .. &amp;#039;|30x30px|alt=&amp;#039; .. item .. &amp;#039;|link=&amp;#039; .. link .. &amp;#039;]]&amp;#039;&lt;br /&gt;
&lt;br /&gt;
	local icon = nil&lt;br /&gt;
	local corner_size = math.floor(tonumber(size) / 2.5)&lt;br /&gt;
	local offset = 0&lt;br /&gt;
	if (corner_size &amp;gt; 21) then&lt;br /&gt;
		offset = 0&lt;br /&gt;
	elseif (corner_size &amp;gt; 8) then&lt;br /&gt;
		offset = math.floor((corner_size - 22) / 2)&lt;br /&gt;
	else&lt;br /&gt;
		offset = -6&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (lib.isEmpty(item)) then&lt;br /&gt;
		return &amp;#039;&amp;#039;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local outerClass = lib.ternary(type:lower() == &amp;#039;item&amp;#039;, &amp;#039;item&amp;#039;, &amp;#039;item &amp;#039; .. type:lower())&lt;br /&gt;
	local result = mw.html.create():tag(&amp;#039;span&amp;#039;):addClass(outerClass)&lt;br /&gt;
&lt;br /&gt;
	local item_image = result:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
		:addClass(&amp;#039;item-image&amp;#039;)&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(&amp;#039;hidden&amp;#039;)&lt;br /&gt;
			:css({&lt;br /&gt;
				width    = size .. &amp;#039;px&amp;#039;,&lt;br /&gt;
				height   = size .. &amp;#039;px&amp;#039;,&lt;br /&gt;
			})&lt;br /&gt;
			:attr(&amp;#039;data-size&amp;#039;, size)&lt;br /&gt;
			:wikitext(file)&lt;br /&gt;
			:done()&lt;br /&gt;
		:tag(&amp;#039;span&amp;#039;)&lt;br /&gt;
			:addClass(&amp;#039;mobile-only&amp;#039;)&lt;br /&gt;
			:wikitext(mobile_file)&lt;br /&gt;
			:done()&lt;br /&gt;
&lt;br /&gt;
	if (icon ~= nil) then&lt;br /&gt;
		item_image:tag(&amp;#039;span&amp;#039;):addClass(&amp;#039;item-icon&amp;#039;)&lt;br /&gt;
			:css({&lt;br /&gt;
				top      = offset .. &amp;#039;px&amp;#039;,&lt;br /&gt;
				width    = corner_size .. &amp;#039;px&amp;#039;,&lt;br /&gt;
				height   = corner_size .. &amp;#039;px&amp;#039;&lt;br /&gt;
			})&lt;br /&gt;
			:attr(&amp;#039;data-offset&amp;#039;, offset)&lt;br /&gt;
			:attr(&amp;#039;data-corner-size&amp;#039;, corner_size)&lt;br /&gt;
			:wikitext(icon)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (newline) then&lt;br /&gt;
		result:addClass(&amp;#039;newline&amp;#039;)&lt;br /&gt;
		result:tag(&amp;#039;br&amp;#039;):addClass(&amp;#039;hidden&amp;#039;)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	function parseAmE(a, b)&lt;br /&gt;
		local a = a or &amp;#039;&amp;#039;&lt;br /&gt;
		local b = b or &amp;#039;&amp;#039;&lt;br /&gt;
		&lt;br /&gt;
		function addPunct(var)&lt;br /&gt;
			if args.comma or args.commaspc then var = var .. &amp;#039;,&amp;#039;&lt;br /&gt;
			elseif args.dot or args.dotspc then var = var .. &amp;#039;.&amp;#039;&lt;br /&gt;
			end&lt;br /&gt;
			var = var&lt;br /&gt;
				:gsub(&amp;#039;%.%.%.&amp;quot;%s-[%.%,]$&amp;#039;, &amp;#039;...&amp;quot;&amp;#039;)	-- no punctuation if quote ends in elipses&lt;br /&gt;
				:gsub(&amp;#039;([%?%!])&amp;quot;%s-[%.%,]$&amp;#039;, &amp;#039;%1&amp;quot;&amp;#039;)	-- no punctuation if quote ends in question or exclamation&lt;br /&gt;
				:gsub(&amp;#039;&amp;quot;%s-([%.%,])$&amp;#039;, &amp;#039;%1&amp;quot;&amp;#039;)		-- move punctuation inside quote for anything else bc AmE&lt;br /&gt;
			return var&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		-- needs to append to the last one with text&lt;br /&gt;
		if lib.isEmpty(b) then a = addPunct(a)&lt;br /&gt;
		else b = addPunct(b)&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
		if args.commaspc or args.dotspc then b = b .. &amp;#039; &amp;#039; end -- space always on the very end&lt;br /&gt;
		&lt;br /&gt;
		return {a, b}&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local item_text = result:tag(&amp;#039;span&amp;#039;):addClass(&amp;#039;item-text&amp;#039;)&lt;br /&gt;
	if (not notext) then&lt;br /&gt;
		local before = newline and &amp;#039;&amp;#039; or &amp;#039; &amp;#039;&lt;br /&gt;
		local ame = ((count or note) and {text, &amp;#039;&amp;#039;} or parseAmE(text, &amp;#039;&amp;#039;))&lt;br /&gt;
		local label = ame[1]&lt;br /&gt;
		local after = ame[2]&lt;br /&gt;
		if (ref and not(count or note)) then after:gsub(&amp;#039;%s*$&amp;#039;, &amp;#039;&amp;#039;) end&lt;br /&gt;
		&lt;br /&gt;
		if (lib.isEmpty(link)) then&lt;br /&gt;
			item_text:wikitext(before, label, after)&lt;br /&gt;
		else&lt;br /&gt;
			item_text:wikitext(before, &amp;#039;[[&amp;#039;, link, &amp;#039;|&amp;#039;, label, &amp;#039;]]&amp;#039;, after)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if (count) then&lt;br /&gt;
		count = (count:gsub(&amp;#039;,&amp;#039;, &amp;#039;&amp;#039;))&lt;br /&gt;
		if tonumber(count)~=nil then count = lib.thousandsSeparator(count) end&lt;br /&gt;
		count = table.concat(note and {count, &amp;#039;&amp;#039;} or parseAmE(count, &amp;#039;&amp;#039;), &amp;#039;&amp;#039;)&lt;br /&gt;
		if (ref and not note) then count:gsub(&amp;#039;%s*$&amp;#039;, &amp;#039;&amp;#039;) end&lt;br /&gt;
		item_text:wikitext((notext and &amp;#039;&amp;#039; or &amp;#039; &amp;#039;) .. &amp;#039;×&amp;#039; .. count)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (note) then&lt;br /&gt;
		local after = table.concat(parseAmE(&amp;#039;&amp;#039;, &amp;#039;&amp;#039;), &amp;#039;&amp;#039;)&lt;br /&gt;
		if (ref) then after:gsub(&amp;#039;%s*$&amp;#039;, &amp;#039;&amp;#039;) end&lt;br /&gt;
		item_text:tag(&amp;#039;small&amp;#039;):wikitext(((notext and not count) and &amp;#039;&amp;#039; or &amp;#039; &amp;#039;),&amp;#039;(&amp;#039;, note, &amp;#039;)&amp;#039;, after)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (ref) then&lt;br /&gt;
		local after = (args.commaspc or args.dotspc) and &amp;#039; &amp;#039; or &amp;#039;&amp;#039; -- avoid space between ref and punctuation &lt;br /&gt;
		item_text:wikitext(ref, after)&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return tostring(result);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>ReinDevildom</name></author>
	</entry>
</feed>