https://en.wikipedia.org/w/index.php?action=history&feed=atom&title=Module%3AIndent Module:Indent - Revision history 2025-06-01T23:22:28Z Revision history for this page on the wiki MediaWiki 1.45.0-wmf.3 https://en.wikipedia.org/w/index.php?title=Module:Indent&diff=1073431986&oldid=prev MusikBot II: Changed protection settings for "Module:Indent": High-risk template or module: 3892 transclusions (more info) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite)) 2022-02-22T18:00:05Z <p>Changed protection settings for &quot;<a href="/wiki/Module:Indent" title="Module:Indent">Module:Indent</a>&quot;: <a href="/wiki/Wikipedia:High-risk_templates" title="Wikipedia:High-risk templates">High-risk template or module</a>: 3892 transclusions (<a href="/wiki/User:MusikBot_II/TemplateProtector" title="User:MusikBot II/TemplateProtector">more info</a>) ([Edit=Require extended confirmed access] (indefinite) [Move=Require extended confirmed access] (indefinite))</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;">← Previous revision</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 18:00, 22 February 2022</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> MusikBot II https://en.wikipedia.org/w/index.php?title=Module:Indent&diff=561801458&oldid=prev Mr. Stradivarius: Protected Module:Indent: High-risk Lua module: in line with template protection level ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite)) 2013-06-27T10:03:59Z <p>Protected Module:Indent: <a href="/wiki/Wikipedia:Lua/Modules" title="Wikipedia:Lua/Modules">High-risk Lua module</a>: in line with template protection level ([Edit=Allow only autoconfirmed users] (indefinite) [Move=Allow only autoconfirmed users] (indefinite))</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;">← Previous revision</td> <td colspan="1" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 10:03, 27 June 2013</td> </tr><tr><td colspan="2" class="diff-notice" lang="en"><div class="mw-diff-empty">(No difference)</div> </td></tr></table> Mr. Stradivarius https://en.wikipedia.org/w/index.php?title=Module:Indent&diff=561800826&oldid=prev Mr. Stradivarius: line break fix for zero or bad input 2013-06-27T09:56:28Z <p>line break fix for zero or bad input</p> <table style="background-color: #fff; color: #202122;" data-mw="interface"> <col class="diff-marker" /> <col class="diff-content" /> <col class="diff-marker" /> <col class="diff-content" /> <tr class="diff-title" lang="en"> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">← Previous revision</td> <td colspan="2" style="background-color: #fff; color: #202122; text-align: center;">Revision as of 09:56, 27 June 2013</td> </tr><tr> <td colspan="2" class="diff-lineno">Line 25:</td> <td colspan="2" class="diff-lineno">Line 25:</td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ret = ret .. '&lt;br /&gt;'</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> ret = ret .. '&lt;br /&gt;'</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- Control for bad or zero input. If found, output <del style="font-weight: bold; text-decoration: none;">nothing,</del> <del style="font-weight: bold; text-decoration: none;">as</del> <del style="font-weight: bold; text-decoration: none;">this</del> <del style="font-weight: bold; text-decoration: none;">was</del></div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> -- Control for bad or zero input. If found, output <ins style="font-weight: bold; text-decoration: none;">the</ins> <ins style="font-weight: bold; text-decoration: none;">line</ins> <ins style="font-weight: bold; text-decoration: none;">breaks only,</ins> </div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> -- the previous behaviour of the template.</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> --<ins style="font-weight: bold; text-decoration: none;"> as this was</ins> the previous behaviour of the template.</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not indent or indent &lt;= 0 or math.floor(indent) ~= indent then</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> if not indent or indent &lt;= 0 or math.floor(indent) ~= indent then</div></td> </tr> <tr> <td class="diff-marker" data-marker="−"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div> return</div></td> <td class="diff-marker" data-marker="+"></td> <td style="color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div> return<ins style="font-weight: bold; text-decoration: none;"> ret</ins></div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> end</div></td> </tr> <tr> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> <td class="diff-marker"></td> <td style="background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div> </div></td> </tr> </table> Mr. Stradivarius https://en.wikipedia.org/w/index.php?title=Module:Indent&diff=561685400&oldid=prev Mr. Stradivarius: create a replacement for Template:Indent 2013-06-26T15:44:20Z <p>create a replacement for <a href="/wiki/Template:Indent" title="Template:Indent">Template:Indent</a></p> <p><b>New page</b></p><div>local p = {}<br /> <br /> function p.indent(frame)<br /> -- Trim whitespace from the arguments and remove blank values.<br /> local args = {}<br /> if type(frame.args) == &#039;table&#039; then<br /> for k, v in pairs( frame.args ) do<br /> v = mw.text.trim(v)<br /> if v ~= &#039;&#039; then<br /> args[k] = v<br /> end<br /> end<br /> end<br /> <br /> -- Set variables.<br /> local indent = tonumber( args[1] )<br /> local br = args[2]<br /> local ret = &#039;&#039;<br /> <br /> -- Insert line breaks to match the functionality of the original template.<br /> -- If &quot;br&quot; is set, we need two line breaks; if not, we just need one.<br /> if br then<br /> ret = ret .. &#039;&lt;br /&gt;&#039; <br /> end<br /> ret = ret .. &#039;&lt;br /&gt;&#039;<br /> <br /> -- Control for bad or zero input. If found, output nothing, as this was<br /> -- the previous behaviour of the template.<br /> if not indent or indent &lt;= 0 or math.floor(indent) ~= indent then<br /> return<br /> end<br /> <br /> -- Generate the indents. The first four cases are special.<br /> if indent == 1 then<br /> return ret .. &#039;&amp;nbsp;&#039;<br /> elseif indent == 2 then<br /> return ret .. &#039;&amp;nbsp;&amp;nbsp;&#039;<br /> elseif indent == 3 then<br /> return ret .. &#039;&amp;nbsp;&amp;emsp;&amp;nbsp;&#039;<br /> elseif indent == 4 then<br /> return ret .. &#039;&amp;nbsp; &amp;emsp; &amp;nbsp;&#039;<br /> end<br /> <br /> -- Set variables for generating the output after indent == 5.<br /> local r = {}<br /> r.base = &#039;&amp;nbsp;&#039; -- Common text to all output.<br /> r.rep = &#039; &amp;emsp; &amp;nbsp;&#039; -- The text to repeat.<br /> r.mod1 = &#039;&amp;nbsp;&#039; -- To return on modulo 1.<br /> r.mod2 = &#039; &amp;emsp;&#039; -- To return on modulo 2.<br /> r.mod3 = &#039; &amp;emsp;&amp;nbsp;&#039; -- To return on modulo 3.<br /> <br /> -- New iteratorText values needed at 5, 9, 13, 17, etc., so repeat the<br /> -- text (indent - 1)/4 times and find the remainder.<br /> local reps = math.floor( (indent - 1) / 4 )<br /> local remainder = math.fmod( indent - 1, 4 )<br /> <br /> -- Generate the indent text.<br /> ret = ret .. r.base .. mw.ustring.rep( r.rep, reps )<br /> if remainder &gt;= 1 and remainder &lt;= 3 then<br /> ret = ret .. r[ &#039;mod&#039; .. remainder ]<br /> end<br /> <br /> return ret<br /> end<br /> <br /> return p</div> Mr. Stradivarius