Module:SortName and Module:SortName/sandbox: Difference between pages
(Difference between pages)
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 | ||
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 | ||