Modulo:Check bibcode: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
←Nuova pagina: require('Modulo:No globals'); local p = {} --[[--------------------------< B I B C O D E >-------------------------------------------------------------------- Validat... |
m modulo no globals obsoleto |
||
(Una versione intermedia di un altro utente non mostrate) | |||
Riga 1:
require('
local p = {}
Line 26 ⟶ 27:
if 19 ~= id:len() then
err_type = '
else
year = id:match ("^(%d%d%d%d)[%a][%a&%.][%a&%.%d][%a&%.%d][%a%d%.]+[%a%.]$") --
if not year then -- if nil then no pattern match
err_type = '
else
local next_year = tonumber(os.date ('%Y'))+1; --get the current year as a number and add one for next year
year = tonumber (year);
if (1000 > year) or (year > next_year) then
err_type = '
end
if id:find('&%.') then
err_type = '
end
end
Line 60 ⟶ 61:
local err_type = bibcode (frame.args[1]);
if err_type then
return '<span style="font-size:100%" class="error citation-comment">
end
return '';
|