Module:Citation/CS1/Identifiers/sandbox: Difference between revisions

Content deleted Content added
update DOI range (attempted); see talk
reset changes list;
Line 1:
--[[
History of changes since last sync: 2023-0108-1412
 
2023-02-20: maint cat for temp bibcodes; see Help_talk:Citation_Style_1#New_maintenance_category%3A_Category%3ACS1_maint%3A_bibcode
2023-04-13: enabled accept-as-written markup for |bibcode=; see Help_talk:Citation_Style_1#bibcode_check_needs_update%2Fexception
2023-06-01: add support for |medrxiv= and {{cite medrxiv}}; see Help_talk:Citation_Style_1#medrxiv?
2023-07-25: https only: for arxiv class links per phab:T337149#8953569
2023-07-26: Update allowed DOI range per Help_talk:Citation_Style_1#https://en.wikipedia.org/wiki/Module:Citation/CS1/Identifiers
]]
 
Line 1,054 ⟶ 1,049:
 
local patterns = {
'%d%d%d%d%d%d%d%d$', -- simple 8-digit identifier; these should be relatively rare
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%dv%d+$', -- y.m.d. date + 8-digit identifier + version (2020-01-01 and later)
'^10%.1101/(20%d%d)%.(%d%d)%.(%d%d)%.%d%d%d%d%d%d%d%d$', -- y.m.d. date + 8-digit identifier (2020-01-01 and later)
Line 1,059 ⟶ 1,055:
for _, pattern in ipairs (patterns) do -- spin through the patterns looking for a match
if id:match (pattern) then
local y, m, d = id:match (pattern); -- found a match, attempt to get year, month and date from the identifier
 
if m then -- m is nil when noid is the 8-digit matchform
if not is_valid_rxiv_date (y, m, d, 'mb') then -- validate the encoded date; 'mb' for medrxiv limit
break; -- date fail; break out early so we don't unset the err_msg_flagerror message
end
end
err_msg_flag = nil; -- we found a match so unset the error message
break; -- and done
end
end err_msg_flag = nil; -- we<err_msg_flag> foundremains aset matchhere andwhen dateno is valid so unset the err_msg_flagmatch
break; -- and done
end -- err_msg flag remains set here when no match
 
if err_msg_flag then