Modul:ISBN
Utseende
Dokumentation [visa] [redigera] [historik] [rensa sidcachen]
Den här modulen används av mallen {{ISBN}}
.
p = {}
p.ISBN = function( f )
local args = f:getParent().args
local arg = args[ 1 ]
if arg then
local copy = arg -- Kopiera så att vi kan vandalisera ISBN-numret internt och sedan returnera arg
copy = copy:gsub( '-', '' )
copy = copy:gsub( ' ', '' )
local length = string.len( copy )
if ( length ~= 10 ) or ( length ~= 13 ) then
return length
end
return mw.getCurrentFrame():preprocess( '{{ISBN|' .. arg .. '}}' )
end
end
return p