Modul:LinkISBN: Unterschied zwischen den Versionen

umgestellt
K (Kleine Änderungen)
(umgestellt)
Zeile 13: Zeile 13:


local ci = require( 'Modul:Check_isxn' )
local ci = require( 'Modul:Check_isxn' )
local lb = require( 'Module:LinkBase' )
local yn = require( 'Modul:Yesno' )
local yn = require( 'Modul:Yesno' )


Zeile 46: Zeile 47:
args.demo    = yn( args.demo or '', false )
args.demo    = yn( args.demo or '', false )


local s
local i, s
local result = ''
local result = ''


if args.isbn ~= '' then
if args.isbn ~= '' then
-- substitude delimiters
-- split separate numbers
for i = 1, #li.delimiters, 1 do
local items = lb.splitItems( args.isbn, li.delimiters )
args.isbn = mw.ustring.gsub( args.isbn, li.delimiters[i], ',' );
end
 
-- split seperate ISBNs and analyse them
-- split seperate ISBNs and analyse them
for s in mw.ustring.gmatch( args.isbn .. ',', '([^,]+)' ) do
for i = 1, #items, 1 do
s = li.linkISBN( s, args.noerror, args.demo )
s = li.linkISBN( items[ i ], args.noerror, args.demo )
if s ~= '' then
if s ~= '' then
if result == '' then result = s
if result == '' then result = s
Anonymer Benutzer