Module:Citation/CS1: Difference between revisions
fix isbn flag, add some spaces
m>Dragons flight (sync to sandbox, this creates temporary transitional hidden error for cite web archiveurl. This will be merged into the visible archiveurl errors next week or so.) |
m>Dragons flight (fix isbn flag, add some spaces) |
||
Line 43: | Line 43: | ||
of the error message in the output is the responsibility of the calling function. | of the error message in the output is the responsibility of the calling function. | ||
]] | ]] | ||
function seterror( error_id, args, raw ) | function seterror( error_id, args, raw, prefix, suffix ) | ||
local error_state = cfg.error_conditions[ error_id ]; | local error_state = cfg.error_conditions[ error_id ]; | ||
prefix = prefix or ""; | |||
suffix = suffix or ""; | |||
if error_state == nil then | if error_state == nil then | ||
Line 71: | Line 73: | ||
return '', false; | return '', false; | ||
end | end | ||
message = prefix .. message .. suffix; | |||
if raw == true then | if raw == true then | ||
Line 118: | Line 122: | ||
if label == nil or label == "" then | if label == nil or label == "" then | ||
label = URL; | label = URL; | ||
error_str = seterror( 'bare_url_missing_title' ); | error_str = seterror( 'bare_url_missing_title', {}, false, " " ); | ||
end | end | ||
if not checkurl( URL ) then | if not checkurl( URL ) then | ||
error_str = seterror( 'bad_url' ) .. error_str; | error_str = seterror( 'bad_url', {}, false, " " ) .. error_str; | ||
end | end | ||
Line 581: | Line 585: | ||
elseif k == 'ISBN' then | elseif k == 'ISBN' then | ||
local ISBN = internallinkid( handler ); | local ISBN = internallinkid( handler ); | ||
if not checkisbn( v ) and (IgnoreISBN == nil or IgnoreISBN == "") then | if not checkisbn( v ) and ( options.IgnoreISBN == nil or options.IgnoreISBN == "" ) then | ||
ISBN = ISBN .. seterror( 'bad_isbn' ); | ISBN = ISBN .. seterror( 'bad_isbn', {}, false, " ", "" ); | ||
end | end | ||
table.insert( new_list, {handler.label, ISBN } ); | table.insert( new_list, {handler.label, ISBN } ); |