https://en.prolewiki.org/index.php?title=Module:If_empty&feed=atom&action=historyModule:If empty - Revision history2024-03-29T07:33:39ZRevision history for this page on the wikiMediaWiki 1.41.0https://en.prolewiki.org/index.php?title=Module:If_empty&diff=2223&oldid=prevForte: 1 revision imported2020-11-16T18:57:52Z<p>1 revision imported</p>
<table style="background-color: #fff; color: #202122;" data-mw="interface">
<tr class="diff-title" lang="en">
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">← Older revision</td>
<td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:57, 16 November 2020</td>
</tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div>
</td></tr></table>Fortehttps://en.prolewiki.org/index.php?title=Module:If_empty&diff=2222&oldid=preven>Jackmcbarn: actually, only the first 8 need this check2014-12-23T21:56:09Z<p>actually, only the first 8 need this check</p>
<p><b>New page</b></p><div>local p = {}<br />
<br />
function p.main(frame)<br />
local args = require('Module:Arguments').getArgs(frame, {wrappers = 'Template:If empty', removeBlanks = false})<br />
<br />
-- For backwards compatibility reasons, the first 8 parameters can be unset instead of being blank,<br />
-- even though there's really no legitimate use case for this. At some point, this will be removed.<br />
local lowestNil = math.huge<br />
for i = 8,1,-1 do<br />
if args[i] == nil then<br />
args[i] = ''<br />
lowestNil = i<br />
end<br />
end<br />
<br />
for k,v in ipairs(args) do<br />
if v ~= '' then<br />
if lowestNil < k then<br />
-- If any uses of this template depend on the behavior above, add them to a tracking category.<br />
-- This is a rather fragile, convoluted, hacky way to do it, but it ensures that this module's output won't be modified<br />
-- by it.<br />
frame:extensionTag('ref', '[[Category:Instances of Template:If_empty missing arguments]]', {group = 'TrackingCategory'})<br />
frame:extensionTag('references', '', {group = 'TrackingCategory'})<br />
end<br />
return v<br />
end<br />
end<br />
end<br />
<br />
return p</div>en>Jackmcbarn