Modul:Wikidata utilities: Unterschied zwischen den Versionen

K
keine Bearbeitungszusammenfassung
(angelegt)
 
KKeine Bearbeitungszusammenfassung
Zeile 1: Zeile 1:
local fw = {}
local fw = {}
function fw.checkId( id )
local i = id and id:upper() or ''
if i ~= '' then
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
end


local function getFirstValue( statements )
local function getFirstValue( statements )
Anonymer Benutzer