Modulo:Citazione: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
opzione per non esaminare i parametri unnamed |
miglioro il controllo dei doi e semplifico estrazione doi inattivo (da en.wiki) |
||
Riga 453:
end
return table.concat({ "[", URL, " ", safe_for_url( label ), "]", error_str });
end▼
else▼
end
Riga 487 ⟶ 464:
local text;
if is_set(inactive) then
local inactive_year = inactive:match("%d%d%d%d") or ''
--text = "[[" .. handler.link .. "|" .. handler.label .. "]]:" .. id;
table.insert( z.error_categories, "Pagine con DOI inattivo dal " .. select_year(inactive) );▼
if is_set(inactive_year) then
▲ table.insert( z.error_categories, "Pagine con DOI inattivo dal " ..
table.insert( z.error_categories, "Pagine con DOI inattivo" ); -- when inactive doesn't contain a recognizable year
▲ end
inactive = " (" .. cfg.messages['inactive'] .. " " .. inactive .. ")"
text = link_id({link = handler.link, label = handler.label,▼
pattern=handler.pattern,id=id,separator=handler.separator, encode=handler.encode})▼
end
▲ pattern=handler.pattern,id=id,separator=handler.separator, encode=handler.encode}) .. (inactive or '')
if nil == id:match("^10%.[^%s–]-/[^%s–]-[^%.,]$") then -- doi must begin with '10.', must contain a fwd slash, must not contain spaces or endashes, and must not end with period or comma
cat = set_error( 'bad_doi' );
end
return text
end
|