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 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( '{{ISBN|' .. arg .. '}}[[Kategori:Sidor med felaktigt ISBN]]' )
		end
		return frame():preprocess( '{{ISBN|' .. arg .. '}}' )
	end
end
return p