Module:Citation/CS1/Identifiers: Difference between revisions

Content deleted Content added
No edit summary
No edit summary
Line 148:
 
if false == valid_ismn then
text = text .. ' ' .. set_error( 'bad_ismn' ) -- add an error message if the issnismn is invalid
end
Line 170:
]]
 
local function issn(id, e)
local issn_copy = id; -- save a copy of unadulterated issn; use this version for display if issn does not validate
local handler = cfg.id_handlers['ISSN'];
local text;
local valid_issn = true;
if e then
handler = cfg.id_handlers['EISSN'];
else
handler = cfg.id_handlers['ISSN'];
end
 
id=id:gsub( "[%s-–]", "" ); -- strip spaces, hyphens, and endashes from the issn
Line 194 ⟶ 200:
if false == valid_issn then
text = text .. ' ' .. set_error( 'bad_issn', e and 'e' or '' ) -- add an error message if the issn is invalid
end
Line 642 ⟶ 648:
elseif k == 'ISSN' then
table.insert( new_list, {handler.label, issn( v ) } );
elseif k == 'EISSN' then
table.insert( new_list, {handler.label, issn( v, true ) } ); -- true distinguishes eissn from issn
elseif k == 'ISBN' then
local ISBN = internal_link_id( handler );