Hoppa till innehållet

Modul:ISBN

Från Wikipedia

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 ]
	local frame = mw.getCurrentFrame()
	if arg then
		local template = '{{ISBN|' .. arg .. '}}'
		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 and length ~= 13 then
			return frame:preprocess( template .. '[[Kategori:Sidor med felaktigt ISBN]]' )
		end
		return frame:preprocess( template )
	end
end
return p