<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMarioGom%2FMultiple_issues</id>
	<title>Module:Sandbox/MarioGom/Multiple issues - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://stockhub.co/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox%2FMarioGom%2FMultiple_issues"/>
	<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/MarioGom/Multiple_issues&amp;action=history"/>
	<updated>2026-07-29T04:38:35Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://stockhub.co/index.php?title=Module:Sandbox/MarioGom/Multiple_issues&amp;diff=145776&amp;oldid=prev</id>
		<title>imported&gt;MarioGom: ←Created page with &#039;local p = {}  local state_initial = 1 local state_first_open_brace = 2 local state_first_closing_brace = 3  local c_open_brace = string.byte(&quot;{&quot;) local c_close_b...&#039;</title>
		<link rel="alternate" type="text/html" href="https://stockhub.co/index.php?title=Module:Sandbox/MarioGom/Multiple_issues&amp;diff=145776&amp;oldid=prev"/>
		<updated>2019-07-26T23:39:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=WP:AES&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:AES (page does not exist)&quot;&gt;←&lt;/a&gt;Created page with &amp;#039;local p = {}  local state_initial = 1 local state_first_open_brace = 2 local state_first_closing_brace = 3  local c_open_brace = string.byte(&amp;quot;{&amp;quot;) local c_close_b...&amp;#039;&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;
&lt;br /&gt;
local state_initial = 1&lt;br /&gt;
local state_first_open_brace = 2&lt;br /&gt;
local state_first_closing_brace = 3&lt;br /&gt;
&lt;br /&gt;
local c_open_brace = string.byte(&amp;quot;{&amp;quot;)&lt;br /&gt;
local c_close_brace = string.byte(&amp;quot;}&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
function p.number_of_templates(content)&lt;br /&gt;
	if content == nil then&lt;br /&gt;
		mw.log(&amp;quot;content is nil&amp;quot;)&lt;br /&gt;
		return 0&lt;br /&gt;
	end&lt;br /&gt;
    local state = state_initial&lt;br /&gt;
    local count = 0&lt;br /&gt;
    local level = 0&lt;br /&gt;
    for i = 1, #content do&lt;br /&gt;
        local c = content:byte(i)&lt;br /&gt;
        if state == state_initial then&lt;br /&gt;
            if c == c_open_brace then&lt;br /&gt;
                state = state_first_open_brace&lt;br /&gt;
            elseif c == c_close_brace then&lt;br /&gt;
                state = state_first_closing_brace&lt;br /&gt;
            end&lt;br /&gt;
        elseif state == state_first_open_brace then&lt;br /&gt;
            if c == c_open_brace then&lt;br /&gt;
                state = state_initial&lt;br /&gt;
                level = level + 1&lt;br /&gt;
            else&lt;br /&gt;
                state = state_initial&lt;br /&gt;
            end&lt;br /&gt;
        elseif state == state_first_closing_brace then&lt;br /&gt;
            if c == c_close_brace then&lt;br /&gt;
                level = level - 1&lt;br /&gt;
                if level == 0 then&lt;br /&gt;
                    count = count + 1&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            state = state_initial&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return count&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function p.multiple_issues(frame)&lt;br /&gt;
	local frame = mw.getCurrentFrame()&lt;br /&gt;
	local first = frame.args[1]&lt;br /&gt;
	local second = frame.args[2]&lt;br /&gt;
	if p.number_of_templates(first) &amp;gt; 1 then&lt;br /&gt;
		return second&lt;br /&gt;
	end&lt;br /&gt;
	return first&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>imported&gt;MarioGom</name></author>
	</entry>
</feed>