Modulo:String/sandbox: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
r |
r |
||
Riga 495:
function str.titolo_alfa(frame)
local articoli = {"I", "Il ", "La ", "L'", "Gli ", "Un ", "Uno ", "Una ", "Un'"}
local default_key = frame.args[1] or ''
if default_key ~= '' then
Line 509 ⟶ 511:
source = _collate(source)
source = mw.ustring.gsub(source, "^['%(%.¡¿ ]*", '')
for _,article in ipairs(articoli) do
source = mw.ustring.gsub(source, "^(" .. article .. ")(.*)$", "%2, %1")
end
source = mw.ustring.gsub(source, '^%l', mw.ustring.upper)
source = mw.text.trim(source)
return source
end
|