Modul:Wikidata utilities: Unterschied zwischen den Versionen

K
keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
KKeine Bearbeitungszusammenfassung
Zeile 4: Zeile 4:
if (not id) or (id == '') then return '' end
if (not id) or (id == '') then return '' end
local i = id:upper()
local i = id:upper()
if mw.ustring.match( i, '^[%d]+$') ~= nil then -- only number
if mw.ustring.match( i, '^Q[%d]+$') == nil then
i = 'Q' .. i
if mw.ustring.match( i, '^[%d]+$') ~= nil then -- only number
elseif mw.ustring.match( i, '^Q[%d]+$') == nil then -- Q and number
i = 'Q' .. i
i = ''
else -- invalid id
i = ''
end
end
end
return i
return i
Anonymer Benutzer