Modul:Check isxn: Unterschied zwischen den Versionen

K
keine Bearbeitungszusammenfassung
K (12 Versionen von w:en:Module:Check_isxn importiert: brauchen wir auch)
KKeine Bearbeitungszusammenfassung
Zeile 51: Zeile 51:
]]
]]


local function check_isbn( isbn_str, error_string )
function p._check_isbn( isbn_str, error_string )
if nil ~= isbn_str:match("[^%s-0-9X]") then -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
if nil ~= isbn_str:match("[^%s-0-9X]") then -- fail if isbn_str contains anything but digits, hyphens, or the uppercase X
return error_string;
return error_string;
Zeile 84: Zeile 84:
]]
]]


local function check_ismn (id, error_string)
function p._check_ismn (id, error_string)
local text;
local text;
local valid_ismn = true;
local valid_ismn = true;
Zeile 112: Zeile 112:
]]
]]


local function check_issn(id, error_string)
function p._check_issn(id, error_string)
local issn_copy = id; -- save a copy of unadulterated issn; use this version for display if issn does not validate
local issn_copy = id; -- save a copy of unadulterated issn; use this version for display if issn does not validate
local text;
local text;
Zeile 136: Zeile 136:


function p.check_isbn(frame)
function p.check_isbn(frame)
return check_isbn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
return p._check_isbn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
end
end


function p.check_ismn(frame)
function p.check_ismn(frame)
return check_ismn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
return p._check_ismn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
end
end


function p.check_issn(frame)
function p.check_issn(frame)
return check_issn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
return p._check_issn(frame.args[1] or frame:getParent().args[1], frame.args['error'] or frame:getParent().args['error'] or 'error')
end
end


return p
return p
Anonymer Benutzer