« Module:Biblio/Références » : différence entre les versions
Contenu supprimé Contenu ajouté
databaseExterne et toutes les fonctions qui l'appelle : Retour à la version Base Numéro dans la base ; affichageLiensExternes : simplification associées |
issn : correction bug lorsque le code contiens un espace ; affichageLiensExternes : accepte DOI, PMID conformément à la doc et l'usage ; améliorations mineures |
||
Ligne 32 :
-- Determines whether an ISBN string is valid
function References.checkisbn( isbn_str )
if type( isbn_str ) ~= 'string' then
return false
end
isbn_str = isbn_str:gsub( '[-%s]', '' ):gsub( 'x', 'X' ) -- remove hyphens and spaces
local len = isbn_str:len()
if len == 10 and isbn_str:match( '^%d+X?$' ) then
return References.is_valid_isxn( isbn_str, 10 )
elseif len == 13 and isbn_str:match( '^%d+$' ) then
local temp = 0
isbn_str = { isbn_str:byte( 1, len ) }
for i
temp = temp + ( 3 - 2 * ( i % 2 ) ) * tonumber( string.char(
end
return temp % 10 == 0
end
end
Ligne 71 ⟶ 63 :
local isbn = validArg( 'isbn', 'ISBN', 'isbn1', 'ISBN1' )
if isbnErr or isbn then
if isbnErrSanitised then
▲ lien = '[[Spécial:Ouvrages de référence/' .. isbnErr:match( '[%dXx -]*' )
.. '|<span class="nowrap">' .. isbnErr .. '</span>]] (édité erroné)'
table.insert( liste, lien )
end
Ligne 117 ⟶ 105 :
if issn then
-- on réduit la chaine aux caractères qui peuvent être dans un code issn (pas de test de longueur)
while
local lien = '<span class="plainlinks noarchive">[http://worldcat.org/issn/'
..
table.insert( liste, lien )
i = i + 1
issn = validArg( 'issn' .. i, 'ISSN' .. i )
end
Ligne 280 ⟶ 266 :
end
end
url =
local texte = validArg( 'texte' ) or 'en ligne'
Ligne 308 ⟶ 294 :
References.lccn( args.lccn ),
References.dnb ( args.dnb ),
References.pmid(
References.pmcid ( validArg( 'pmcid', 'pmc' ) ),
References.doi(
References.jstor( args.jstor ),
References.bibcode( args.bibcode ),
Ligne 353 ⟶ 339 :
consult = string.sub( consult, 1, -2)
end
if (string.match(consult, '^
consulteLe = 'consulté le '
else
Ligne 424 ⟶ 410 :
return References.indicationDeFormat( ext ) .. ' ' .. texte
else
return ' ' ..
end
end
|