Module:SortName and Module:SortName/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Bility
m Bility moved page Module:Sandbox/Bility/SortName to Module:SortName without leaving a redirect: moving out of sandbox
 
imported>Lemondoge
Slight simplification (else if to elseif)
 
Line 33: Line 33:
                 if romannumeral == -1 then
                 if romannumeral == -1 then
                     pagetitle = text1 .. ', ' .. text2
                     pagetitle = text1 .. ', ' .. text2
                elseif string.find( text2, ' ' ) == nil then
                    pagetitle = text2 .. ' ' .. romannumeral
                 else
                 else
                     if string.find( text2, ' ' ) == nil then
                     text1 = string.sub( text2, string.find( text2, ' [^ ]*$' ) + 1, #text2 )
                        pagetitle = text2 .. ' ' .. romannumeral
                    text2 = string.sub( text2, 0, string.find( text2, ' [^ ]*$' ) - 1 )
                    else
                    pagetitle = text1 .. ' ' .. romannumeral .. ', ' .. text2
                        text1 = string.sub( text2, string.find( text2, ' [^ ]*$' ) + 1, #text2 )
                        text2 = string.sub( text2, 0, string.find( text2, ' [^ ]*$' ) - 1 )
                        pagetitle = text1 .. ' ' .. romannumeral .. ', ' .. text2
                    end
                 end
                 end
             end
             end