Module:Citation/CS1/Identifiers: Difference between revisions

Jump to navigation Jump to search
sync from sandbox;
(synch from sandbox;)
(sync from sandbox;)
Line 1:
 
local identifiers = {};
 
 
--[[--------------------------< F O R W A R D D E C L A R A T I O N S >--------------------------------------
Line 44 ⟶ 41:
end
if is_set (options.q) and mw.wikibase then -- wikibase test here avoids script errors in third party wikis that aren't using mw.wikibase extension
if is_set (options.q) then
wd_article = mw.wikibase.getEntity (options.q):getSitelink (this_wiki_code .. 'wiki'); -- fetch article title from wd
if wd_article then
Line 66 ⟶ 63:
 
local function internal_link_id(options)
local id = mw.ustring.gsub (options.id, '%d', cfg.date_names.local_digits); -- translate 'local' digits to Western 0-9
 
return table.concat (
Line 75 ⟶ 73:
{
options.prefix,
id, -- translated to western digits
options.id,
options.suffix or ''
}),
substitute (cfg.presentation['bdi'], {'', mw.text.nowiki (options.id)}) -- bdi tags to prevent Latn script identifiers from being reversed at rtl language wikis
mw.text.nowiki (options.id)
); -- nowiki because MediaWiki still has magic links for ISBN and the like; TODO: is it really required?
);
});
end
Line 396 ⟶ 394:
local inactive_year = inactive:match("%d%d%d%d") or ''; -- try to get the year portion from the inactive date
if is_set(inactive_year) then
table.insert( z.error_categories, "Pages with DOIs inactive sinceas of " .. inactive_year );
else
table.insert( z.error_categories, "Pages with inactive DOIs" ); -- when inactive doesn't contain a recognizable year
Line 732 ⟶ 730:
--[[--------------------------< O C L C >----------------------------------------------------------------------
 
Validate and format an oclc id. https://www.oclc.org/batchload/controlnumber.en.html {{dead link}}
archived at: https://web.archive.org/web/20161228233804/https://www.oclc.org/batchload/controlnumber.en.html
 
]]
Line 1,161 ⟶ 1,160:
end
 
 
--[[--------------------------< E X P O R T E D F U N C T I O N S >------------------------------------------
]]
 
return {
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu