Modul:Wikidata utilities: Unterschied zwischen den Versionen
KKeine Bearbeitungszusammenfassung |
Keine Bearbeitungszusammenfassung |
||
Zeile 2: | Zeile 2: | ||
function fw.checkId( id ) | function fw.checkId( id ) | ||
local i = | if (not id) or (id == '') then return '' end | ||
local i = id:upper() | |||
if mw.ustring.match( i, '^[%d]+$') ~= nil then -- only number | |||
i = 'Q' .. i | |||
elseif mw.ustring.match( i, '^Q[%d]+$') == nil then -- Q and number | |||
i = '' | |||
end | end | ||
return i | return i |