<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://wiki.evisionservices.com/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.evisionservices.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trappist+the+monk</id>
		<title>eVision - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.evisionservices.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trappist+the+monk"/>
		<link rel="alternate" type="text/html" href="http://wiki.evisionservices.com/index.php?title=Special:Contributions/Trappist_the_monk"/>
		<updated>2026-04-20T23:05:57Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.23.1</generator>

	<entry>
		<id>http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1</id>
		<title>Module:Citation/CS1</title>
		<link rel="alternate" type="text/html" href="http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1"/>
				<updated>2014-03-30T12:26:52Z</updated>
		
		<summary type="html">&lt;p&gt;Trappist the monk: Synch from sandbox;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;local z = {&lt;br /&gt;
    error_categories = {};&lt;br /&gt;
    error_ids = {};&lt;br /&gt;
    message_tail = {};&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Include translation message hooks, ID and error handling configuration settings.&lt;br /&gt;
--local cfg = mw.loadData( 'Module:Citation/CS1/Configuration/sandbox' );&lt;br /&gt;
&lt;br /&gt;
-- Contains a list of all recognized parameters&lt;br /&gt;
--local whitelist = mw.loadData( 'Module:Citation/CS1/Whitelist/sandbox' );&lt;br /&gt;
&lt;br /&gt;
--local dates = require('Module:Citation/CS1/Date_validation/sandbox').dates		-- location of date validation code&lt;br /&gt;
&lt;br /&gt;
-- Whether variable is set or not&lt;br /&gt;
function is_set( var )&lt;br /&gt;
    return not (var == nil or var == '');&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- First set variable or nil if none&lt;br /&gt;
function first_set(...)&lt;br /&gt;
    local list = {...};&lt;br /&gt;
    for _, var in pairs(list) do&lt;br /&gt;
        if is_set( var ) then&lt;br /&gt;
            return var;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Whether needle is in haystack&lt;br /&gt;
function inArray( needle, haystack )&lt;br /&gt;
    if needle == nil then&lt;br /&gt;
        return false;&lt;br /&gt;
    end&lt;br /&gt;
    for n,v in ipairs( haystack ) do&lt;br /&gt;
        if v == needle then&lt;br /&gt;
            return n;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return false;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Categorize and emit an error message when the citation contains one or more deprecated parameters.  Because deprecated parameters (currently |day=, |month=,&lt;br /&gt;
|coauthor=, and |coauthors=) aren't related to each other and because these parameters may be concatenated into the variables used by |date= and |author#= (and aliases)&lt;br /&gt;
details of which parameter caused the error message are not provided.  Only one error message is emitted regarless of the number of deprecated parameters in the citation.&lt;br /&gt;
]]&lt;br /&gt;
function deprecated_parameter()&lt;br /&gt;
	if true ~= Page_in_deprecated_cat then	-- if we haven't been here before then set a &lt;br /&gt;
		Page_in_deprecated_cat=true;		-- sticky flag so that if there are more than one deprecated parameter the category is added only once&lt;br /&gt;
--		table.insert( z.message_tail, { seterror( 'deprecated_params', {error_message}, true ) } );		-- add error message&lt;br /&gt;
		table.insert( z.message_tail, { seterror( 'deprecated_params', {}, true ) } );		-- add error message&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Populates numbered arguments in a message string using an argument table.&lt;br /&gt;
function substitute( msg, args )&lt;br /&gt;
--	return args and tostring( mw.message.newRawMessage( msg, args ) ) or msg;&lt;br /&gt;
	return args and mw.message.newRawMessage( msg, args ):plain() or msg;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Apply kerning to open the space between the quote mark provided by the Module and a leading or trailing quote mark contained in a |title= or |chapter= parameter's value.&lt;br /&gt;
This function will positive kern  either single or double quotes:&lt;br /&gt;
	&amp;quot;'Unkerned title with leading and trailing single quote marks'&amp;quot;&lt;br /&gt;
	&amp;quot; 'Kerned title with leading and trailing single quote marks' &amp;quot; (in real life the kerning isn't as wide as this example)&lt;br /&gt;
]]&lt;br /&gt;
function kern_quotes (str)&lt;br /&gt;
	local left='&amp;lt;span style=&amp;quot;padding-left:0.2em;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;';		-- spacing to use when title contains leading single or double quote mark&lt;br /&gt;
	local right='&amp;lt;span style=&amp;quot;padding-right:0.2em;&amp;quot;&amp;gt;%1&amp;lt;/span&amp;gt;';		-- spacing to use when title contains trailing single or double quote mark&lt;br /&gt;
	&lt;br /&gt;
	if  str:match (&amp;quot;^[\&amp;quot;\'][^\']&amp;quot;) then&lt;br /&gt;
		str = string.gsub( str, &amp;quot;^[\&amp;quot;\']&amp;quot;, left, 1 );				-- replace (captured) leading single or double quote with left-side &amp;lt;span&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
	if str:match (&amp;quot;[^\'][\&amp;quot;\']$&amp;quot;) then&lt;br /&gt;
		str = string.gsub( str, &amp;quot;[\&amp;quot;\']$&amp;quot;, right, 1 );			-- replace (captured) trailing single or double quote with right-side &amp;lt;span&amp;gt;&lt;br /&gt;
	end&lt;br /&gt;
	return str;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Wraps a string using a message_list configuration taking one argument&lt;br /&gt;
function wrap( key, str, lower )&lt;br /&gt;
    if not is_set( str ) then&lt;br /&gt;
        return &amp;quot;&amp;quot;;&lt;br /&gt;
    elseif inArray( key, { 'italic-title', 'trans-italic-title' } ) then&lt;br /&gt;
        str = safeforitalics( str );&lt;br /&gt;
    end&lt;br /&gt;
    if lower == true then&lt;br /&gt;
        return substitute( cfg.messages[key]:lower(), {str} );&lt;br /&gt;
    else&lt;br /&gt;
        return substitute( cfg.messages[key], {str} );&lt;br /&gt;
    end        &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Argument wrapper.  This function provides support for argument &lt;br /&gt;
mapping defined in the configuration file so that multiple names&lt;br /&gt;
can be transparently aliased to single internal variable.&lt;br /&gt;
]]&lt;br /&gt;
function argument_wrapper( args )&lt;br /&gt;
    local origin = {};&lt;br /&gt;
    &lt;br /&gt;
    return setmetatable({&lt;br /&gt;
        ORIGIN = function( self, k )&lt;br /&gt;
            local dummy = self[k]; --force the variable to be loaded.&lt;br /&gt;
            return origin[k];&lt;br /&gt;
        end&lt;br /&gt;
    },&lt;br /&gt;
    {&lt;br /&gt;
        __index = function ( tbl, k )&lt;br /&gt;
            if origin[k] ~= nil then&lt;br /&gt;
                return nil;&lt;br /&gt;
            end&lt;br /&gt;
            &lt;br /&gt;
            local args, list, v = args, cfg.aliases[k];&lt;br /&gt;
            &lt;br /&gt;
            if type( list ) == 'table' then&lt;br /&gt;
                v, origin[k] = selectone( args, list, 'redundant_parameters' );&lt;br /&gt;
                if origin[k] == nil then&lt;br /&gt;
                    origin[k] = ''; -- Empty string, not nil&lt;br /&gt;
                end&lt;br /&gt;
            elseif list ~= nil then&lt;br /&gt;
                v, origin[k] = args[list], list;&lt;br /&gt;
            else&lt;br /&gt;
                -- maybe let through instead of raising an error?&lt;br /&gt;
                -- v, origin[k] = args[k], k;&lt;br /&gt;
                error( cfg.messages['unknown_argument_map'] );&lt;br /&gt;
            end&lt;br /&gt;
            &lt;br /&gt;
            -- Empty strings, not nil;&lt;br /&gt;
            if v == nil then&lt;br /&gt;
                v = cfg.defaults[k] or '';&lt;br /&gt;
                origin[k] = '';&lt;br /&gt;
            end&lt;br /&gt;
            &lt;br /&gt;
            tbl = rawset( tbl, k, v );&lt;br /&gt;
            return v;&lt;br /&gt;
        end,&lt;br /&gt;
    });&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Looks for a parameter's name in the whitelist.&lt;br /&gt;
&lt;br /&gt;
Parameters in the whitelist can have three values:&lt;br /&gt;
	true - active, supported parameters&lt;br /&gt;
	false - deprecated, supported parameters&lt;br /&gt;
	nil - unsupported parameters&lt;br /&gt;
]]&lt;br /&gt;
function validate( name )&lt;br /&gt;
	local name = tostring( name );&lt;br /&gt;
	local state = whitelist.basic_arguments[ name ];&lt;br /&gt;
	&lt;br /&gt;
	-- Normal arguments&lt;br /&gt;
	if true == state then return true; end		-- valid actively supported parameter&lt;br /&gt;
	if false == state then&lt;br /&gt;
		deprecated_parameter ();				-- parameter is deprecated but still supported&lt;br /&gt;
		return true;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	-- Arguments with numbers in them&lt;br /&gt;
	name = name:gsub( &amp;quot;%d+&amp;quot;, &amp;quot;#&amp;quot; );				-- replace digit(s) with # (last25 becomes last#&lt;br /&gt;
	state = whitelist.numbered_arguments[ name ];&lt;br /&gt;
	if true == state then return true; end		-- valid actively supported parameter&lt;br /&gt;
	if false == state then&lt;br /&gt;
		deprecated_parameter ();				-- parameter is deprecated but still supported&lt;br /&gt;
		return true;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return false;								-- Not supported because not found or name is set to nil&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a comment for error trapping&lt;br /&gt;
function errorcomment( content, hidden )&lt;br /&gt;
    return wrap( hidden and 'hidden-error' or 'visible-error', content );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Sets an error condition and returns the appropriate error message.  The actual placement&lt;br /&gt;
of the error message in the output is the responsibility of the calling function.&lt;br /&gt;
]]&lt;br /&gt;
function seterror( error_id, arguments, raw, prefix, suffix )&lt;br /&gt;
    local error_state = cfg.error_conditions[ error_id ];&lt;br /&gt;
    &lt;br /&gt;
    prefix = prefix or &amp;quot;&amp;quot;;&lt;br /&gt;
    suffix = suffix or &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    if error_state == nil then&lt;br /&gt;
        error( cfg.messages['undefined_error'] );&lt;br /&gt;
    elseif is_set( error_state.category ) then&lt;br /&gt;
        table.insert( z.error_categories, error_state.category );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local message = substitute( error_state.message, arguments );&lt;br /&gt;
    &lt;br /&gt;
    message = message .. &amp;quot; ([[&amp;quot; .. cfg.messages['help page link'] .. &lt;br /&gt;
        &amp;quot;#&amp;quot; .. error_state.anchor .. &amp;quot;|&amp;quot; ..&lt;br /&gt;
        cfg.messages['help page label'] .. &amp;quot;]])&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    z.error_ids[ error_id ] = true;&lt;br /&gt;
    if inArray( error_id, { 'bare_url_missing_title', 'trans_missing_title' } )&lt;br /&gt;
            and z.error_ids['citation_missing_title'] then&lt;br /&gt;
        return '', false;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    message = table.concat({ prefix, message, suffix });&lt;br /&gt;
    &lt;br /&gt;
    if raw == true then&lt;br /&gt;
        return message, error_state.hidden;&lt;br /&gt;
    end        &lt;br /&gt;
        &lt;br /&gt;
    return errorcomment( message, error_state.hidden );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a wiki style external link&lt;br /&gt;
function externallinkid(options)&lt;br /&gt;
    local url_string = options.id;&lt;br /&gt;
    if options.encode == true or options.encode == nil then&lt;br /&gt;
        url_string = mw.uri.encode( url_string );&lt;br /&gt;
    end&lt;br /&gt;
    return mw.ustring.format( '[[%s|%s]]%s[%s%s%s %s]',&lt;br /&gt;
        options.link, options.label, options.separator or &amp;quot;&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
        options.prefix, url_string, options.suffix or &amp;quot;&amp;quot;,&lt;br /&gt;
        mw.text.nowiki(options.id)&lt;br /&gt;
    );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a wiki style internal link&lt;br /&gt;
function internallinkid(options)&lt;br /&gt;
    return mw.ustring.format( '[[%s|%s]]%s[[%s%s%s|%s]]',&lt;br /&gt;
        options.link, options.label, options.separator or &amp;quot;&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
        options.prefix, options.id, options.suffix or &amp;quot;&amp;quot;,&lt;br /&gt;
        mw.text.nowiki(options.id)&lt;br /&gt;
    );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Format an external link with error checking&lt;br /&gt;
function externallink( URL, label, source )&lt;br /&gt;
    local error_str = &amp;quot;&amp;quot;;&lt;br /&gt;
    if not is_set( label ) then&lt;br /&gt;
        label = URL;&lt;br /&gt;
        if is_set( source ) then&lt;br /&gt;
            error_str = seterror( 'bare_url_missing_title', { wrap( 'parameter', source ) }, false, &amp;quot; &amp;quot; );&lt;br /&gt;
        else&lt;br /&gt;
            error( cfg.messages[&amp;quot;bare_url_no_origin&amp;quot;] );&lt;br /&gt;
        end            &lt;br /&gt;
    end&lt;br /&gt;
    if not checkurl( URL ) then&lt;br /&gt;
        error_str = seterror( 'bad_url', {}, false, &amp;quot; &amp;quot; ) .. error_str;&lt;br /&gt;
    end&lt;br /&gt;
    return table.concat({ &amp;quot;[&amp;quot;, URL, &amp;quot; &amp;quot;, safeforurl( label ), &amp;quot;]&amp;quot;, error_str });&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a link to Amazon&lt;br /&gt;
function amazon(id, domain)&lt;br /&gt;
    if not is_set(domain) then &lt;br /&gt;
        domain = &amp;quot;com&amp;quot;&lt;br /&gt;
    elseif ( &amp;quot;jp&amp;quot; == domain or &amp;quot;uk&amp;quot; == domain ) then&lt;br /&gt;
        domain = &amp;quot;co.&amp;quot; .. domain&lt;br /&gt;
    end&lt;br /&gt;
    local handler = cfg.id_handlers['ASIN'];&lt;br /&gt;
    return externallinkid({link = handler.link,&lt;br /&gt;
        label=handler.label , prefix=&amp;quot;//www.amazon.&amp;quot;..domain..&amp;quot;/dp/&amp;quot;,id=id,&lt;br /&gt;
        encode=handler.encode, separator = handler.separator})&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Format LCCN link and do simple error checking.  LCCN is a character string 8-12 characters long. The length of the LCCN dictates the character type of the first 1-3 characters; the&lt;br /&gt;
rightmost eight are always digits. http://info-uri.info/registry/OAIHandler?verb=GetRecord&amp;amp;metadataPrefix=reg&amp;amp;identifier=info:lccn/&lt;br /&gt;
&lt;br /&gt;
length = 8 then all digits&lt;br /&gt;
length = 9 then lccn[1] is alpha&lt;br /&gt;
length = 10 then lccn[1] and lccn[2] are both alpha or both digits&lt;br /&gt;
length = 11 then lccn[1] is alpha, lccn[2] and lccn[3] are both alpha or both digits&lt;br /&gt;
length = 12 then lccn[1] and lccn[2] are both alpha&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
function lccn(id)&lt;br /&gt;
	local handler = cfg.id_handlers['LCCN'];&lt;br /&gt;
	local err_cat =  '';								-- presume that LCCN is valid&lt;br /&gt;
&lt;br /&gt;
	local len = id:len();								-- get the length of the lccn&lt;br /&gt;
&lt;br /&gt;
	if 8 == len then&lt;br /&gt;
		if id:match(&amp;quot;[^%d]&amp;quot;) then						-- if LCCN has anything but digits (nil if only digits)&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_lccn' );	-- set an error message&lt;br /&gt;
		end&lt;br /&gt;
	elseif 9 == len then								-- LCCN should be adddddddd&lt;br /&gt;
		if nil == id:match(&amp;quot;%a%d%d%d%d%d%d%d%d&amp;quot;) then			-- does it match our pattern?&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_lccn' );	-- set an error message&lt;br /&gt;
		end&lt;br /&gt;
	elseif 10 == len then								-- LCCN should be aadddddddd or dddddddddd&lt;br /&gt;
		if id:match(&amp;quot;[^%d]&amp;quot;) then							-- if LCCN has anything but digits (nil if only digits) ...&lt;br /&gt;
			if nil == id:match(&amp;quot;^%a%a%d%d%d%d%d%d%d%d&amp;quot;) then	-- ... see if it matches our pattern&lt;br /&gt;
				err_cat = ' ' .. seterror( 'bad_lccn' );	-- no match, set an error message&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	elseif 11 == len then								-- LCCN should be aaadddddddd or adddddddddd&lt;br /&gt;
		if not (id:match(&amp;quot;^%a%a%a%d%d%d%d%d%d%d%d&amp;quot;) or id:match(&amp;quot;^%a%d%d%d%d%d%d%d%d%d%d&amp;quot;)) then	-- see if it matches one of our patterns&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_lccn' );	-- no match, set an error message&lt;br /&gt;
		end&lt;br /&gt;
	elseif 12 == len then								-- LCCN should be aadddddddddd&lt;br /&gt;
		if not id:match(&amp;quot;^%a%a%d%d%d%d%d%d%d%d%d%d&amp;quot;) then	-- see if it matches our pattern&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_lccn' );	-- no match, set an error message&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		err_cat = ' ' .. seterror( 'bad_lccn' );		-- wrong length, set an error message&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return externallinkid({link = handler.link, label = handler.label,&lt;br /&gt;
			prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Format PMID and do simple error checking.  PMIDs are sequential numbers beginning at 1 and counting up.  This code checks the PMID to see that it&lt;br /&gt;
contains only digits and is less than test_limit; the value in local variable test_limit will need to be updated periodically as more PMIDs are issued.&lt;br /&gt;
]]&lt;br /&gt;
function pmid(id)&lt;br /&gt;
	local test_limit = 30000000;						-- update this value as PMIDs approach&lt;br /&gt;
	local handler = cfg.id_handlers['PMID'];&lt;br /&gt;
	local err_cat =  '';								-- presume that PMID is valid&lt;br /&gt;
	&lt;br /&gt;
	if id:match(&amp;quot;[^%d]&amp;quot;) then							-- if PMID has anything but digits&lt;br /&gt;
		err_cat = ' ' .. seterror( 'bad_pmid' );		-- set an error message&lt;br /&gt;
	else												-- PMID is only digits&lt;br /&gt;
		local id_num = tonumber(id);					-- convert id to a number for range testing&lt;br /&gt;
		if 1 &amp;gt; id_num or test_limit &amp;lt; id_num then		-- if PMID is outside test limit boundaries&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_pmid' );	-- set an error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	return externallinkid({link = handler.link, label = handler.label,&lt;br /&gt;
			prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Determines if a PMC identifier's online version is embargoed. Compares the date in |embargo= against today's date.  If embargo date is&lt;br /&gt;
in the future, returns true; otherwse, returns false because the embargo has expired or |embargo= not set in this cite.&lt;br /&gt;
]]&lt;br /&gt;
function is_embargoed(embargo)&lt;br /&gt;
	if is_set(embargo) then&lt;br /&gt;
		local lang = mw.getContentLanguage();&lt;br /&gt;
		local good1, embargo_date, good2, todays_date;&lt;br /&gt;
		good1, embargo_date = pcall( lang.formatDate, lang, 'U', embargo );&lt;br /&gt;
		good2, todays_date = pcall( lang.formatDate, lang, 'U' );&lt;br /&gt;
	&lt;br /&gt;
		if good1 and good2 and tonumber( embargo_date ) &amp;gt;= tonumber( todays_date ) then	--is embargo date is in the future?&lt;br /&gt;
			return true;	-- still embargoed&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return false;			-- embargo expired or |embargo= not set&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Format a PMC, do simple error checking, and check for embargoed articles.&lt;br /&gt;
&lt;br /&gt;
The embargo parameter takes a date for a value. If the embargo date is in the future&lt;br /&gt;
the PMC identifier will not be linked to the article.  If the embargo specifies a date in the past, or if it is empty or omitted, then&lt;br /&gt;
the PMC identifier is linked to the article through the link at cfg.id_handlers['PMC'].prefix.&lt;br /&gt;
&lt;br /&gt;
PMCs are sequential numbers beginning at 1 and counting up.  This code checks the PMC to see that it contains only digits and is less&lt;br /&gt;
than test_limit; the value in local variable test_limit will need to be updated periodically as more PMCs are issued.&lt;br /&gt;
]]&lt;br /&gt;
function pmc(id, embargo)&lt;br /&gt;
	local test_limit = 5000000;							-- update this value as PMCs approach&lt;br /&gt;
	local handler = cfg.id_handlers['PMC'];&lt;br /&gt;
	local err_cat =  '';								-- presume that PMC is valid&lt;br /&gt;
    &lt;br /&gt;
	local text;&lt;br /&gt;
&lt;br /&gt;
	if id:match(&amp;quot;[^%d]&amp;quot;) then							-- if PMC has anything but digits&lt;br /&gt;
		err_cat = ' ' .. seterror( 'bad_pmc' );			-- set an error message&lt;br /&gt;
	else												-- PMC is only digits&lt;br /&gt;
		local id_num = tonumber(id);					-- convert id to a number for range testing&lt;br /&gt;
		if 1 &amp;gt; id_num or test_limit &amp;lt; id_num then		-- if PMC is outside test limit boundaries&lt;br /&gt;
			err_cat = ' ' .. seterror( 'bad_pmc' );		-- set an error message&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if is_embargoed(embargo) then&lt;br /&gt;
		text=&amp;quot;[[&amp;quot; .. handler.link .. &amp;quot;|&amp;quot; .. handler.label .. &amp;quot;]]:&amp;quot; .. handler.separator .. id .. err_cat;	--still embargoed so no external link&lt;br /&gt;
	else&lt;br /&gt;
		text = externallinkid({link = handler.link, label = handler.label,			--no embargo date, ok to link to article&lt;br /&gt;
			prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;&lt;br /&gt;
	end&lt;br /&gt;
	return text;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a DOI and checks for DOI errors.&lt;br /&gt;
&lt;br /&gt;
-- DOI names contain two parts: prefix and suffix separated by a forward slash.&lt;br /&gt;
--  Prefix: directory indicator '10.' followed by a registrant code&lt;br /&gt;
--  Suffix: character string of any length chosen by the registrant&lt;br /&gt;
&lt;br /&gt;
-- This function checks a DOI name for: prefix/suffix.  If the doi name contains spaces or endashes,&lt;br /&gt;
-- or, if it ends with a period or a comma, this function will emit a bad_doi error message.&lt;br /&gt;
&lt;br /&gt;
-- DOI names are case-insensitive and can incorporate any printable Unicode characters so the test for spaces, endash,&lt;br /&gt;
-- and terminal punctuation may not be technically correct but it appears, that in practice these characters are rarely if ever used in doi names.&lt;br /&gt;
&lt;br /&gt;
function doi(id, inactive)&lt;br /&gt;
    local cat = &amp;quot;&amp;quot;&lt;br /&gt;
    local handler = cfg.id_handlers['DOI'];&lt;br /&gt;
    &lt;br /&gt;
    local text;&lt;br /&gt;
	if is_set(inactive) then&lt;br /&gt;
		local inactive_year = inactive:match(&amp;quot;%d%d%d%d&amp;quot;) or '';		-- try to get the year portion from the inactive date&lt;br /&gt;
		text = &amp;quot;[[&amp;quot; .. handler.link .. &amp;quot;|&amp;quot; .. handler.label .. &amp;quot;]]:&amp;quot; .. id;&lt;br /&gt;
		if is_set(inactive_year) then&lt;br /&gt;
			table.insert( z.error_categories, &amp;quot;Pages with DOIs inactive since &amp;quot; .. inactive_year );&lt;br /&gt;
		else&lt;br /&gt;
			table.insert( z.error_categories, &amp;quot;Pages with inactive DOIs&amp;quot; );	-- when inactive doesn't contain a recognizable year&lt;br /&gt;
		end&lt;br /&gt;
		inactive = &amp;quot; (&amp;quot; .. cfg.messages['inactive'] .. &amp;quot; &amp;quot; .. inactive .. &amp;quot;)&amp;quot; &lt;br /&gt;
	else &lt;br /&gt;
		text = externallinkid({link = handler.link, label = handler.label,&lt;br /&gt;
			prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})&lt;br /&gt;
		inactive = &amp;quot;&amp;quot; &lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if nil == id:match(&amp;quot;^10%.[^%s–]-/[^%s–]-[^%.,]$&amp;quot;) 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&lt;br /&gt;
		cat = ' ' .. seterror( 'bad_doi' );&lt;br /&gt;
	end&lt;br /&gt;
	return text .. inactive .. cat &lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats an OpenLibrary link, and checks for associated errors.&lt;br /&gt;
function openlibrary(id)&lt;br /&gt;
    local code = id:sub(-1,-1)&lt;br /&gt;
    local handler = cfg.id_handlers['OL'];&lt;br /&gt;
    if ( code == &amp;quot;A&amp;quot; ) then&lt;br /&gt;
        return externallinkid({link=handler.link, label=handler.label,&lt;br /&gt;
            prefix=&amp;quot;http://openlibrary.org/authors/OL&amp;quot;,id=id, separator=handler.separator,&lt;br /&gt;
            encode = handler.encode})&lt;br /&gt;
    elseif ( code == &amp;quot;M&amp;quot; ) then&lt;br /&gt;
        return externallinkid({link=handler.link, label=handler.label,&lt;br /&gt;
            prefix=&amp;quot;http://openlibrary.org/books/OL&amp;quot;,id=id, separator=handler.separator,&lt;br /&gt;
            encode = handler.encode})&lt;br /&gt;
    elseif ( code == &amp;quot;W&amp;quot; ) then&lt;br /&gt;
        return externallinkid({link=handler.link, label=handler.label,&lt;br /&gt;
            prefix= &amp;quot;http://openlibrary.org/works/OL&amp;quot;,id=id, separator=handler.separator,&lt;br /&gt;
            encode = handler.encode})&lt;br /&gt;
    else&lt;br /&gt;
        return externallinkid({link=handler.link, label=handler.label,&lt;br /&gt;
            prefix= &amp;quot;http://openlibrary.org/OL&amp;quot;,id=id, separator=handler.separator,&lt;br /&gt;
            encode = handler.encode}) .. &lt;br /&gt;
            ' ' .. seterror( 'bad_ol' );&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Validate and format an issn.  This code fixes the case where an editor has included an ISSN in the citation but has separated the two groups of four&lt;br /&gt;
digits with a space.  When that condition occurred, the resulting link looked like this:&lt;br /&gt;
&lt;br /&gt;
	|issn=0819 4327 gives: [http://www.worldcat.org/issn/0819 4327 0819 4327]  -- can't have spaces in an external link&lt;br /&gt;
	&lt;br /&gt;
This code now prevents that by inserting a hyphen at the issn midpoint.  It also validates the issn for length and makes sure that the checkdigit agrees&lt;br /&gt;
with the calculated value.  Incorrect length (8 digits), characters other than 0-9 and X, or checkdigit / calculated value mismatch will all cause a check issn&lt;br /&gt;
error message.  The issn is always displayed with a hyphen, even if the issn was given as a single group of 8 digits.&lt;br /&gt;
]]&lt;br /&gt;
function issn(id)&lt;br /&gt;
	local issn_copy = id;		-- save a copy of unadulterated issn; use this version for display if issn does not validate&lt;br /&gt;
	local handler = cfg.id_handlers['ISSN'];&lt;br /&gt;
	local text;&lt;br /&gt;
	local valid_issn = true;&lt;br /&gt;
&lt;br /&gt;
	id=id:gsub( &amp;quot;[%s-–]&amp;quot;, &amp;quot;&amp;quot; );									-- strip spaces, hyphens, and ndashes from the issn&lt;br /&gt;
&lt;br /&gt;
	if 8 ~= id:len() or nil == id:match( &amp;quot;^%d*X?$&amp;quot; ) then		-- validate the issn: 8 didgits long, containing only 0-9 or X in the last position&lt;br /&gt;
		valid_issn=false;										-- wrong length or improper character&lt;br /&gt;
	else&lt;br /&gt;
		valid_issn=is_valid_isxn(id, 8);						-- validate issn&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if true == valid_issn then&lt;br /&gt;
		id = string.sub( id, 1, 4 ) .. &amp;quot;-&amp;quot; .. string.sub( id, 5 );	-- if valid, display correctly formatted version&lt;br /&gt;
	else&lt;br /&gt;
		id = issn_copy;											-- if not valid, use the show the invalid issn with error message&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	text = externallinkid({link = handler.link, label = handler.label,&lt;br /&gt;
		prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})&lt;br /&gt;
 &lt;br /&gt;
	if false == valid_issn then&lt;br /&gt;
		text = text .. ' ' .. seterror( 'bad_issn' )			-- add an error message if the issn is invalid&lt;br /&gt;
	end &lt;br /&gt;
	&lt;br /&gt;
	return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This function sets default title types (equivalent to the citation including |type=&amp;lt;default value&amp;gt;) for those citations that have defaults.&lt;br /&gt;
Also handles the special case where it is desireable to omit the title type from the rendered citation (|type=none).&lt;br /&gt;
]]&lt;br /&gt;
function set_titletype(cite_class, title_type)&lt;br /&gt;
	if is_set(title_type) then&lt;br /&gt;
		if &amp;quot;none&amp;quot; == title_type then&lt;br /&gt;
			title_type = &amp;quot;&amp;quot;;					-- if |type=none then type parameter not displayed&lt;br /&gt;
		end&lt;br /&gt;
		return title_type;						-- if |type= has been set to any other value use that value&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if &amp;quot;AV media notes&amp;quot; == cite_class or &amp;quot;DVD notes&amp;quot; == cite_class then		-- if this citation is cite AV media notes or cite DVD notes&lt;br /&gt;
		return &amp;quot;Media notes&amp;quot;;					-- display AV media notes / DVD media notes annotation&lt;br /&gt;
&lt;br /&gt;
	elseif &amp;quot;podcast&amp;quot; == cite_class then			-- if this citation is cite podcast&lt;br /&gt;
		return &amp;quot;Podcast&amp;quot;;						-- display podcast annotation&lt;br /&gt;
&lt;br /&gt;
	elseif &amp;quot;pressrelease&amp;quot; == cite_class then	-- if this citation is cite press release&lt;br /&gt;
		return &amp;quot;Press release&amp;quot;;					-- display press release annotation&lt;br /&gt;
&lt;br /&gt;
	elseif &amp;quot;techreport&amp;quot; == cite_class then		-- if this citation is cite techreport&lt;br /&gt;
		return &amp;quot;Technical report&amp;quot;;				-- display techreport annotation&lt;br /&gt;
	&lt;br /&gt;
	elseif &amp;quot;thesis&amp;quot; == cite_class then			-- if this citation is cite thesis (degree option handled after this function returns)&lt;br /&gt;
			return &amp;quot;Thesis&amp;quot;;					-- display simple thesis annotation (without |degree= modification)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Determines whether a URL string is valid&lt;br /&gt;
&lt;br /&gt;
At present the only check is whether the string appears to &lt;br /&gt;
be prefixed with a URI scheme.  It is not determined whether &lt;br /&gt;
the URI scheme is valid or whether the URL is otherwise well &lt;br /&gt;
formed.&lt;br /&gt;
]]&lt;br /&gt;
function checkurl( url_str )&lt;br /&gt;
    -- Protocol-relative or URL scheme&lt;br /&gt;
    return url_str:sub(1,2) == &amp;quot;//&amp;quot; or url_str:match( &amp;quot;^[^/]*:&amp;quot; ) ~= nil;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Removes irrelevant text and dashes from ISBN number&lt;br /&gt;
-- Similar to that used for Special:BookSources&lt;br /&gt;
function cleanisbn( isbn_str )&lt;br /&gt;
    return isbn_str:gsub( &amp;quot;[^-0-9X]&amp;quot;, &amp;quot;&amp;quot; );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Extract page numbers from external wikilinks in any of the |page=, |pages=, or |at= parameters for use in COinS.&lt;br /&gt;
function get_coins_pages (pages)&lt;br /&gt;
	if not is_set (pages) then return pages; end			-- if no page numbers then we're done&lt;br /&gt;
	&lt;br /&gt;
    while true do&lt;br /&gt;
		pattern = pages:match(&amp;quot;%[([%w/:\.]+%s+)[%w%d].*%]&amp;quot;);	-- pattern is the opening bracket, the url and following space(s): &amp;quot;[url &amp;quot;&lt;br /&gt;
		if nil == pattern then break; end					-- no more urls&lt;br /&gt;
		pages = pages:gsub(pattern, &amp;quot;&amp;quot;);					-- remove as many instances of pattern as possible&lt;br /&gt;
	end&lt;br /&gt;
	pages = pages:gsub(&amp;quot;[%[%]]&amp;quot;, &amp;quot;&amp;quot;);						-- remove the brackets&lt;br /&gt;
	pages = pages:gsub(&amp;quot;–&amp;quot;, &amp;quot;-&amp;quot; );							-- replace endashes with hyphens&lt;br /&gt;
	pages = pages:gsub(&amp;quot;&amp;amp;%w+;&amp;quot;, &amp;quot;-&amp;quot; );						-- and replace html entities (&amp;amp;ndash; etc) with hyphens; do we need to replace numerical entities like &amp;amp;#32; and the like?&lt;br /&gt;
	return pages;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
ISBN-10 and ISSN validator code calculates checksum across all isbn/issn digits including the check digit. ISBN-13 is checked in checkisbn().&lt;br /&gt;
If the number is valid the result will be 0. Before calling this function, issbn/issn must be checked for length and stripped of dashes,&lt;br /&gt;
spaces and other non-isxn characters.&lt;br /&gt;
]]&lt;br /&gt;
function is_valid_isxn (isxn_str, len)&lt;br /&gt;
	local temp = 0;&lt;br /&gt;
	isxn_str = { isxn_str:byte(1, len) };	-- make a table of bytes&lt;br /&gt;
	len = len+1;							-- adjust to be a loop counter&lt;br /&gt;
	for i, v in ipairs( isxn_str ) do		-- loop through all of the bytes and calculate the checksum&lt;br /&gt;
		if v == string.byte( &amp;quot;X&amp;quot; ) then		-- if checkdigit is X&lt;br /&gt;
			temp = temp + 10*( len - i );	-- it represents 10 decimal&lt;br /&gt;
		else&lt;br /&gt;
			temp = temp + tonumber( string.char(v) )*(len-i);&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return temp % 11 == 0;					-- returns true if calculation result is zero&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Determines whether an ISBN string is valid&lt;br /&gt;
function checkisbn( isbn_str )&lt;br /&gt;
	if nil ~= isbn_str:match(&amp;quot;[^%s-0-9X]&amp;quot;) then return false; end		-- fail if isbn_str contains anything but digits, hyphens, or the uppercase X&lt;br /&gt;
	isbn_str = isbn_str:gsub( &amp;quot;-&amp;quot;, &amp;quot;&amp;quot; ):gsub( &amp;quot; &amp;quot;, &amp;quot;&amp;quot; );	-- remove hyphens and spaces&lt;br /&gt;
	local len = isbn_str:len();&lt;br /&gt;
 &lt;br /&gt;
	if len ~= 10 and len ~= 13 then&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if len == 10 then&lt;br /&gt;
		if isbn_str:match( &amp;quot;^%d*X?$&amp;quot; ) == nil then return false; end&lt;br /&gt;
		return is_valid_isxn(isbn_str, 10);&lt;br /&gt;
	else&lt;br /&gt;
		local temp = 0;&lt;br /&gt;
		if isbn_str:match( &amp;quot;^97[89]%d*$&amp;quot; ) == nil then return false; end	-- isbn13 begins with 978 or 979&lt;br /&gt;
		isbn_str = { isbn_str:byte(1, len) };&lt;br /&gt;
		for i, v in ipairs( isbn_str ) do&lt;br /&gt;
			temp = temp + (3 - 2*(i % 2)) * tonumber( string.char(v) );&lt;br /&gt;
		end&lt;br /&gt;
		return temp % 10 == 0;&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets the display text for a wikilink like [[A|B]] or [[B]] gives B&lt;br /&gt;
function removewikilink( str )&lt;br /&gt;
    return (str:gsub( &amp;quot;%[%[([^%[%]]*)%]%]&amp;quot;, function(l)&lt;br /&gt;
        return l:gsub( &amp;quot;^[^|]*|(.*)$&amp;quot;, &amp;quot;%1&amp;quot; ):gsub(&amp;quot;^%s*(.-)%s*$&amp;quot;, &amp;quot;%1&amp;quot;);&lt;br /&gt;
    end));&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Escape sequences for content that will be used for URL descriptions&lt;br /&gt;
function safeforurl( str )&lt;br /&gt;
    if str:match( &amp;quot;%[%[.-%]%]&amp;quot; ) ~= nil then &lt;br /&gt;
        table.insert( z.message_tail, { seterror( 'wikilink_in_url', {}, true ) } );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return str:gsub( '[%[%]\n]', {    &lt;br /&gt;
        ['['] = '&amp;amp;#91;',&lt;br /&gt;
        [']'] = '&amp;amp;#93;',&lt;br /&gt;
        ['\n'] = ' ' } );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Converts a hyphen to a dash&lt;br /&gt;
function hyphentodash( str )&lt;br /&gt;
    if not is_set(str) or str:match( &amp;quot;[%[%]{}&amp;lt;&amp;gt;]&amp;quot; ) ~= nil then&lt;br /&gt;
        return str;&lt;br /&gt;
    end    &lt;br /&gt;
    return str:gsub( '-', '–' );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Protects a string that will be wrapped in wiki italic markup '' ... ''&lt;br /&gt;
function safeforitalics( str )&lt;br /&gt;
    --[[ Note: We can not use &amp;lt;i&amp;gt; for italics, as the expected behavior for&lt;br /&gt;
    italics specified by ''...'' in the title is that they will be inverted&lt;br /&gt;
    (i.e. unitalicized) in the resulting references.  In addition, &amp;lt;i&amp;gt; and ''&lt;br /&gt;
    tend to interact poorly under Mediawiki's HTML tidy. ]]&lt;br /&gt;
    &lt;br /&gt;
    if not is_set(str) then&lt;br /&gt;
        return str;&lt;br /&gt;
    else&lt;br /&gt;
        if str:sub(1,1) == &amp;quot;'&amp;quot; then str = &amp;quot;&amp;lt;span /&amp;gt;&amp;quot; .. str; end&lt;br /&gt;
        if str:sub(-1,-1) == &amp;quot;'&amp;quot; then str = str .. &amp;quot;&amp;lt;span /&amp;gt;&amp;quot;; end&lt;br /&gt;
        &lt;br /&gt;
        -- Remove newlines as they break italics.&lt;br /&gt;
        return str:gsub( '\n', ' ' );&lt;br /&gt;
    end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Joins a sequence of strings together while checking for duplicate separation&lt;br /&gt;
characters.&lt;br /&gt;
]]&lt;br /&gt;
function safejoin( tbl, duplicate_char )&lt;br /&gt;
    --[[&lt;br /&gt;
    Note: we use string functions here, rather than ustring functions.&lt;br /&gt;
    &lt;br /&gt;
    This has considerably faster performance and should work correctly as &lt;br /&gt;
    long as the duplicate_char is strict ASCII.  The strings&lt;br /&gt;
    in tbl may be ASCII or UTF8.&lt;br /&gt;
    ]]&lt;br /&gt;
    &lt;br /&gt;
    local str = '';&lt;br /&gt;
    local comp = '';&lt;br /&gt;
    local end_chr = '';&lt;br /&gt;
    local trim;&lt;br /&gt;
    for _, value in ipairs( tbl ) do&lt;br /&gt;
        if value == nil then value = ''; end&lt;br /&gt;
        &lt;br /&gt;
        if str == '' then&lt;br /&gt;
            str = value;&lt;br /&gt;
        elseif value ~= '' then&lt;br /&gt;
            if value:sub(1,1) == '&amp;lt;' then&lt;br /&gt;
                -- Special case of values enclosed in spans and other markup.&lt;br /&gt;
                comp = value:gsub( &amp;quot;%b&amp;lt;&amp;gt;&amp;quot;, &amp;quot;&amp;quot; );&lt;br /&gt;
            else&lt;br /&gt;
                comp = value;&lt;br /&gt;
            end&lt;br /&gt;
            &lt;br /&gt;
            if comp:sub(1,1) == duplicate_char then&lt;br /&gt;
                trim = false;&lt;br /&gt;
                end_chr = str:sub(-1,-1);&lt;br /&gt;
                -- str = str .. &amp;quot;&amp;lt;HERE(enchr=&amp;quot; .. end_chr.. &amp;quot;)&amp;quot;&lt;br /&gt;
                if end_chr == duplicate_char then&lt;br /&gt;
                    str = str:sub(1,-2);&lt;br /&gt;
                elseif end_chr == &amp;quot;'&amp;quot; then&lt;br /&gt;
                    if str:sub(-3,-1) == duplicate_char .. &amp;quot;''&amp;quot; then&lt;br /&gt;
                        str = str:sub(1, -4) .. &amp;quot;''&amp;quot;;&lt;br /&gt;
                    elseif str:sub(-5,-1) == duplicate_char .. &amp;quot;]]''&amp;quot; then&lt;br /&gt;
                        trim = true;&lt;br /&gt;
                    elseif str:sub(-4,-1) == duplicate_char .. &amp;quot;]''&amp;quot; then&lt;br /&gt;
                        trim = true;&lt;br /&gt;
                    end&lt;br /&gt;
                elseif end_chr == &amp;quot;]&amp;quot; then&lt;br /&gt;
                    if str:sub(-3,-1) == duplicate_char .. &amp;quot;]]&amp;quot; then&lt;br /&gt;
                        trim = true;&lt;br /&gt;
                    elseif str:sub(-2,-1) == duplicate_char .. &amp;quot;]&amp;quot; then&lt;br /&gt;
                        trim = true;&lt;br /&gt;
                    end&lt;br /&gt;
                elseif end_chr == &amp;quot; &amp;quot; then&lt;br /&gt;
                    if str:sub(-2,-1) == duplicate_char .. &amp;quot; &amp;quot; then&lt;br /&gt;
                        str = str:sub(1,-3);&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
&lt;br /&gt;
                if trim then&lt;br /&gt;
                    if value ~= comp then &lt;br /&gt;
                        local dup2 = duplicate_char;&lt;br /&gt;
                        if dup2:match( &amp;quot;%A&amp;quot; ) then dup2 = &amp;quot;%&amp;quot; .. dup2; end&lt;br /&gt;
                        &lt;br /&gt;
                        value = value:gsub( &amp;quot;(%b&amp;lt;&amp;gt;)&amp;quot; .. dup2, &amp;quot;%1&amp;quot;, 1 )&lt;br /&gt;
                    else&lt;br /&gt;
                        value = value:sub( 2, -1 );&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
            str = str .. value;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    return str;&lt;br /&gt;
end  &lt;br /&gt;
&lt;br /&gt;
-- Attempts to convert names to initials.&lt;br /&gt;
function reducetoinitials(first)&lt;br /&gt;
    local initials = {}&lt;br /&gt;
    for word in string.gmatch(first, &amp;quot;%S+&amp;quot;) do&lt;br /&gt;
        table.insert(initials, string.sub(word,1,1)) -- Vancouver format does not include full stops.&lt;br /&gt;
    end&lt;br /&gt;
    return table.concat(initials) -- Vancouver format does not include spaces.&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Formats a list of people (e.g. authors / editors) &lt;br /&gt;
function listpeople(control, people)&lt;br /&gt;
    local sep = control.sep;&lt;br /&gt;
    local namesep = control.namesep&lt;br /&gt;
    local format = control.format&lt;br /&gt;
    local maximum = control.maximum&lt;br /&gt;
    local lastauthoramp = control.lastauthoramp;&lt;br /&gt;
    local text = {}&lt;br /&gt;
    local etal = false;&lt;br /&gt;
    &lt;br /&gt;
    if sep:sub(-1,-1) ~= &amp;quot; &amp;quot; then sep = sep .. &amp;quot; &amp;quot; end&lt;br /&gt;
    if maximum ~= nil and maximum &amp;lt; 1 then return &amp;quot;&amp;quot;, 0; end&lt;br /&gt;
    &lt;br /&gt;
    for i,person in ipairs(people) do&lt;br /&gt;
        if is_set(person.last) then&lt;br /&gt;
            local mask = person.mask&lt;br /&gt;
            local one&lt;br /&gt;
            local sep_one = sep;&lt;br /&gt;
            if maximum ~= nil and i &amp;gt; maximum then&lt;br /&gt;
                etal = true;&lt;br /&gt;
                break;&lt;br /&gt;
            elseif (mask ~= nil) then&lt;br /&gt;
                local n = tonumber(mask)&lt;br /&gt;
                if (n ~= nil) then&lt;br /&gt;
                    one = string.rep(&amp;quot;&amp;amp;mdash;&amp;quot;,n)&lt;br /&gt;
                else&lt;br /&gt;
                    one = mask;&lt;br /&gt;
                    sep_one = &amp;quot; &amp;quot;;&lt;br /&gt;
                end&lt;br /&gt;
            else&lt;br /&gt;
                one = person.last&lt;br /&gt;
                local first = person.first&lt;br /&gt;
                if is_set(first) then &lt;br /&gt;
                    if ( &amp;quot;vanc&amp;quot; == format ) then first = reducetoinitials(first) end&lt;br /&gt;
                    one = one .. namesep .. first &lt;br /&gt;
                end&lt;br /&gt;
                if is_set(person.link) then one = &amp;quot;[[&amp;quot; .. person.link .. &amp;quot;|&amp;quot; .. one .. &amp;quot;]]&amp;quot; end&lt;br /&gt;
                if is_set(person.link) and nil ~= person.link:find(&amp;quot;//&amp;quot;) then one = one .. &amp;quot; &amp;quot; .. seterror( 'bad_authorlink' ) end	-- check for url in author link;&lt;br /&gt;
            end&lt;br /&gt;
            table.insert( text, one )&lt;br /&gt;
            table.insert( text, sep_one )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local count = #text / 2;&lt;br /&gt;
    if count &amp;gt; 0 then &lt;br /&gt;
        if count &amp;gt; 1 and is_set(lastauthoramp) and not etal then&lt;br /&gt;
            text[#text-2] = &amp;quot; &amp;amp; &amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
        text[#text] = nil; &lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local result = table.concat(text) -- construct list&lt;br /&gt;
    if etal then &lt;br /&gt;
        local etal_text = cfg.messages['et al'];&lt;br /&gt;
        result = result .. &amp;quot; &amp;quot; .. etal_text;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- if necessary wrap result in &amp;lt;span&amp;gt; tag to format in Small Caps&lt;br /&gt;
    if ( &amp;quot;scap&amp;quot; == format ) then result = &lt;br /&gt;
        '&amp;lt;span class=&amp;quot;smallcaps&amp;quot; style=&amp;quot;font-variant:small-caps&amp;quot;&amp;gt;' .. result .. '&amp;lt;/span&amp;gt;';&lt;br /&gt;
    end &lt;br /&gt;
    return result, count&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Generates a CITEREF anchor ID.&lt;br /&gt;
function anchorid( options )&lt;br /&gt;
    return &amp;quot;CITEREF&amp;quot; .. table.concat( options );&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Gets name list from the input arguments&lt;br /&gt;
function extractnames(args, list_name)&lt;br /&gt;
    local names = {};&lt;br /&gt;
    local i = 1;&lt;br /&gt;
    local last;&lt;br /&gt;
    &lt;br /&gt;
    while true do&lt;br /&gt;
        last = selectone( args, cfg.aliases[list_name .. '-Last'], 'redundant_parameters', i );&lt;br /&gt;
        if not is_set(last) then&lt;br /&gt;
            -- just in case someone passed in an empty parameter&lt;br /&gt;
            break;&lt;br /&gt;
        end&lt;br /&gt;
        names[i] = {&lt;br /&gt;
            last = last,&lt;br /&gt;
            first = selectone( args, cfg.aliases[list_name .. '-First'], 'redundant_parameters', i ),&lt;br /&gt;
            link = selectone( args, cfg.aliases[list_name .. '-Link'], 'redundant_parameters', i ),&lt;br /&gt;
            mask = selectone( args, cfg.aliases[list_name .. '-Mask'], 'redundant_parameters', i )&lt;br /&gt;
        };&lt;br /&gt;
        i = i + 1;&lt;br /&gt;
    end&lt;br /&gt;
    return names;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Populates ID table from arguments using configuration settings&lt;br /&gt;
function extractids( args )&lt;br /&gt;
    local id_list = {};&lt;br /&gt;
    for k, v in pairs( cfg.id_handlers ) do    &lt;br /&gt;
        v = selectone( args, v.parameters, 'redundant_parameters' );&lt;br /&gt;
        if is_set(v) then id_list[k] = v; end&lt;br /&gt;
    end&lt;br /&gt;
    return id_list;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- Takes a table of IDs and turns it into a table of formatted ID outputs.&lt;br /&gt;
function buildidlist( id_list, options )&lt;br /&gt;
    local new_list, handler = {};&lt;br /&gt;
    &lt;br /&gt;
    function fallback(k) return { __index = function(t,i) return cfg.id_handlers[k][i] end } end;&lt;br /&gt;
    &lt;br /&gt;
    for k, v in pairs( id_list ) do&lt;br /&gt;
        -- fallback to read-only cfg&lt;br /&gt;
        handler = setmetatable( { ['id'] = v }, fallback(k) );&lt;br /&gt;
        &lt;br /&gt;
        if handler.mode == 'external' then&lt;br /&gt;
            table.insert( new_list, {handler.label, externallinkid( handler ) } );&lt;br /&gt;
        elseif handler.mode == 'internal' then&lt;br /&gt;
            table.insert( new_list, {handler.label, internallinkid( handler ) } );&lt;br /&gt;
        elseif handler.mode ~= 'manual' then&lt;br /&gt;
            error( cfg.messages['unknown_ID_mode'] );&lt;br /&gt;
        elseif k == 'DOI' then&lt;br /&gt;
            table.insert( new_list, {handler.label, doi( v, options.DoiBroken ) } );&lt;br /&gt;
        elseif k == 'ASIN' then&lt;br /&gt;
            table.insert( new_list, {handler.label, amazon( v, options.ASINTLD ) } ); &lt;br /&gt;
        elseif k == 'LCCN' then&lt;br /&gt;
            table.insert( new_list, {handler.label, lccn( v ) } );&lt;br /&gt;
        elseif k == 'OL' then&lt;br /&gt;
            table.insert( new_list, {handler.label, openlibrary( v ) } );&lt;br /&gt;
        elseif k == 'PMC' then&lt;br /&gt;
            table.insert( new_list, {handler.label, pmc( v, options.Embargo ) } );&lt;br /&gt;
        elseif k == 'PMID' then&lt;br /&gt;
            table.insert( new_list, {handler.label, pmid( v ) } );&lt;br /&gt;
        elseif k == 'ISSN' then&lt;br /&gt;
        	table.insert( new_list, {handler.label, issn( v ) } );&lt;br /&gt;
        elseif k == 'ISBN' then&lt;br /&gt;
            local ISBN = internallinkid( handler );&lt;br /&gt;
            if not checkisbn( v ) and not is_set(options.IgnoreISBN) then&lt;br /&gt;
                ISBN = ISBN .. seterror( 'bad_isbn', {}, false, &amp;quot; &amp;quot;, &amp;quot;&amp;quot; );&lt;br /&gt;
            end&lt;br /&gt;
            table.insert( new_list, {handler.label, ISBN } );                &lt;br /&gt;
        else&lt;br /&gt;
            error( cfg.messages['unknown_manual_ID'] );&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    function comp( a, b )	-- used in following table.sort()&lt;br /&gt;
        return a[1] &amp;lt; b[1];&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    table.sort( new_list, comp );&lt;br /&gt;
    for k, v in ipairs( new_list ) do&lt;br /&gt;
        new_list[k] = v[2];&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return new_list;&lt;br /&gt;
end&lt;br /&gt;
  &lt;br /&gt;
-- Chooses one matching parameter from a list of parameters to consider&lt;br /&gt;
-- Generates an error if more than one match is present.&lt;br /&gt;
function selectone( args, possible, error_condition, index )&lt;br /&gt;
    local value = nil;&lt;br /&gt;
    local selected = '';&lt;br /&gt;
    local error_list = {};&lt;br /&gt;
    &lt;br /&gt;
    if index ~= nil then index = tostring(index); end&lt;br /&gt;
    &lt;br /&gt;
    -- Handle special case of &amp;quot;#&amp;quot; replaced by empty string&lt;br /&gt;
    if index == '1' then&lt;br /&gt;
        for _, v in ipairs( possible ) do&lt;br /&gt;
            v = v:gsub( &amp;quot;#&amp;quot;, &amp;quot;&amp;quot; );&lt;br /&gt;
            if is_set(args[v]) then&lt;br /&gt;
                if value ~= nil and selected ~= v then&lt;br /&gt;
                    table.insert( error_list, v );&lt;br /&gt;
                else&lt;br /&gt;
                    value = args[v];&lt;br /&gt;
                    selected = v;&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end        &lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    for _, v in ipairs( possible ) do&lt;br /&gt;
        if index ~= nil then&lt;br /&gt;
            v = v:gsub( &amp;quot;#&amp;quot;, index );&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(args[v]) then&lt;br /&gt;
            if value ~= nil and selected ~=  v then&lt;br /&gt;
                table.insert( error_list, v );&lt;br /&gt;
            else&lt;br /&gt;
                value = args[v];&lt;br /&gt;
                selected = v;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if #error_list &amp;gt; 0 then&lt;br /&gt;
        local error_str = &amp;quot;&amp;quot;;&lt;br /&gt;
        for _, k in ipairs( error_list ) do&lt;br /&gt;
            if error_str ~= &amp;quot;&amp;quot; then error_str = error_str .. cfg.messages['parameter-separator'] end&lt;br /&gt;
            error_str = error_str .. wrap( 'parameter', k );&lt;br /&gt;
        end&lt;br /&gt;
        if #error_list &amp;gt; 1 then&lt;br /&gt;
            error_str = error_str .. cfg.messages['parameter-final-separator'];&lt;br /&gt;
        else&lt;br /&gt;
            error_str = error_str .. cfg.messages['parameter-pair-separator'];&lt;br /&gt;
        end&lt;br /&gt;
        error_str = error_str .. wrap( 'parameter', selected );&lt;br /&gt;
        table.insert( z.message_tail, { seterror( error_condition, {error_str}, true ) } );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return value, selected;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- COinS metadata (see &amp;lt;http://ocoins.info/&amp;gt;) allows automated tools to parse&lt;br /&gt;
-- the citation information.&lt;br /&gt;
function COinS(data)&lt;br /&gt;
    if 'table' ~= type(data) or nil == next(data) then&lt;br /&gt;
        return '';&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local ctx_ver = &amp;quot;Z39.88-2004&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    -- treat table strictly as an array with only set values.&lt;br /&gt;
    local OCinSoutput = setmetatable( {}, {&lt;br /&gt;
        __newindex = function(self, key, value)&lt;br /&gt;
            if is_set(value) then&lt;br /&gt;
                rawset( self, #self+1, table.concat{ key, '=', mw.uri.encode( removewikilink( value ) ) } );&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    });&lt;br /&gt;
    &lt;br /&gt;
    if is_set(data.Chapter) then&lt;br /&gt;
        OCinSoutput.rft_val_fmt = &amp;quot;info:ofi/fmt:kev:mtx:book&amp;quot;;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.genre&amp;quot;] = &amp;quot;bookitem&amp;quot;;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.btitle&amp;quot;] = data.Chapter;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.atitle&amp;quot;] = data.Title;&lt;br /&gt;
    elseif is_set(data.Periodical) then&lt;br /&gt;
        OCinSoutput.rft_val_fmt = &amp;quot;info:ofi/fmt:kev:mtx:journal&amp;quot;;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.genre&amp;quot;] = &amp;quot;article&amp;quot;;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.jtitle&amp;quot;] = data.Periodical;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.atitle&amp;quot;] = data.Title;&lt;br /&gt;
    else&lt;br /&gt;
        OCinSoutput.rft_val_fmt = &amp;quot;info:ofi/fmt:kev:mtx:book&amp;quot;;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.genre&amp;quot;] = &amp;quot;book&amp;quot;&lt;br /&gt;
        OCinSoutput[&amp;quot;rft.btitle&amp;quot;] = data.Title;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    OCinSoutput[&amp;quot;rft.place&amp;quot;] = data.PublicationPlace;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.date&amp;quot;] = data.Date;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.series&amp;quot;] = data.Series;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.volume&amp;quot;] = data.Volume;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.issue&amp;quot;] = data.Issue;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.pages&amp;quot;] = data.Pages;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.edition&amp;quot;] = data.Edition;&lt;br /&gt;
    OCinSoutput[&amp;quot;rft.pub&amp;quot;] = data.PublisherName;&lt;br /&gt;
    &lt;br /&gt;
    for k, v in pairs( data.ID_list ) do&lt;br /&gt;
        local id, value = cfg.id_handlers[k].COinS;&lt;br /&gt;
        if k == 'ISBN' then value = cleanisbn( v ); else value = v; end&lt;br /&gt;
        if string.sub( id or &amp;quot;&amp;quot;, 1, 4 ) == 'info' then&lt;br /&gt;
            OCinSoutput[&amp;quot;rft_id&amp;quot;] = table.concat{ id, &amp;quot;/&amp;quot;, v };&lt;br /&gt;
        else&lt;br /&gt;
            OCinSoutput[ id ] = value;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local last, first;&lt;br /&gt;
    for k, v in ipairs( data.Authors ) do&lt;br /&gt;
        last, first = v.last, v.first;&lt;br /&gt;
        if k == 1 then&lt;br /&gt;
            if is_set(last) then&lt;br /&gt;
                OCinSoutput[&amp;quot;rft.aulast&amp;quot;] = last;&lt;br /&gt;
            end&lt;br /&gt;
            if is_set(first) then &lt;br /&gt;
                OCinSoutput[&amp;quot;rft.aufirst&amp;quot;] = first;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(last) and is_set(first) then&lt;br /&gt;
            OCinSoutput[&amp;quot;rft.au&amp;quot;] = table.concat{ last, &amp;quot;, &amp;quot;, first };&lt;br /&gt;
        elseif is_set(last) then&lt;br /&gt;
            OCinSoutput[&amp;quot;rft.au&amp;quot;] = last;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    OCinSoutput.rft_id = data.URL;&lt;br /&gt;
    OCinSoutput.rfr_id = table.concat{ &amp;quot;info:sid/&amp;quot;, mw.site.server:match( &amp;quot;[^/]*$&amp;quot; ), &amp;quot;:&amp;quot;, data.RawPage };&lt;br /&gt;
    OCinSoutput = setmetatable( OCinSoutput, nil );&lt;br /&gt;
    &lt;br /&gt;
    -- sort with version string always first, and combine.&lt;br /&gt;
    table.sort( OCinSoutput );&lt;br /&gt;
    table.insert( OCinSoutput, 1, &amp;quot;ctx_ver=&amp;quot; .. ctx_ver );  -- such as &amp;quot;Z39.88-2004&amp;quot;&lt;br /&gt;
    return table.concat(OCinSoutput, &amp;quot;&amp;amp;&amp;quot;);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
This is the main function doing the majority of the citation&lt;br /&gt;
formatting.&lt;br /&gt;
]]&lt;br /&gt;
function citation0( config, args)&lt;br /&gt;
    --[[ &lt;br /&gt;
    Load Input Parameters&lt;br /&gt;
    The argment_wrapper facillitates the mapping of multiple&lt;br /&gt;
    aliases to single internal variable.&lt;br /&gt;
    ]]&lt;br /&gt;
    local A = argument_wrapper( args );&lt;br /&gt;
&lt;br /&gt;
    local i &lt;br /&gt;
    local PPrefix = A['PPrefix']&lt;br /&gt;
    local PPPrefix = A['PPPrefix']&lt;br /&gt;
    if is_set( A['NoPP'] ) then PPPrefix = &amp;quot;&amp;quot; PPrefix = &amp;quot;&amp;quot; end&lt;br /&gt;
    &lt;br /&gt;
    -- Pick out the relevant fields from the arguments.  Different citation templates&lt;br /&gt;
    -- define different field names for the same underlying things.    &lt;br /&gt;
    local Authors = A['Authors'];&lt;br /&gt;
    local a = extractnames( args, 'AuthorList' );&lt;br /&gt;
&lt;br /&gt;
    local Coauthors = A['Coauthors'];&lt;br /&gt;
    local Others = A['Others'];&lt;br /&gt;
    local Editors = A['Editors'];&lt;br /&gt;
    local e = extractnames( args, 'EditorList' );&lt;br /&gt;
&lt;br /&gt;
    local Year = A['Year'];&lt;br /&gt;
    local PublicationDate = A['PublicationDate'];&lt;br /&gt;
    local OrigYear = A['OrigYear'];&lt;br /&gt;
    local Date = A['Date'];&lt;br /&gt;
    local LayDate = A['LayDate'];&lt;br /&gt;
    ------------------------------------------------- Get title data&lt;br /&gt;
    local Title = A['Title'];&lt;br /&gt;
    local BookTitle = A['BookTitle'];&lt;br /&gt;
    local Conference = A['Conference'];&lt;br /&gt;
    local TransTitle = A['TransTitle'];&lt;br /&gt;
    local TitleNote = A['TitleNote'];&lt;br /&gt;
    local TitleLink = A['TitleLink'];&lt;br /&gt;
    local Chapter = A['Chapter'];&lt;br /&gt;
    local ChapterLink = A['ChapterLink'];&lt;br /&gt;
    local TransChapter = A['TransChapter'];&lt;br /&gt;
    local TitleType = A['TitleType'];&lt;br /&gt;
    local Degree = A['Degree'];&lt;br /&gt;
    local Docket = A['Docket'];&lt;br /&gt;
    local ArchiveURL = A['ArchiveURL'];&lt;br /&gt;
    local URL = A['URL']&lt;br /&gt;
    local URLorigin = A:ORIGIN('URL');&lt;br /&gt;
    local ChapterURL = A['ChapterURL'];&lt;br /&gt;
    local ChapterURLorigin = A:ORIGIN('ChapterURL');&lt;br /&gt;
    local ConferenceURL = A['ConferenceURL'];&lt;br /&gt;
    local ConferenceURLorigin = A:ORIGIN('ConferenceURL');&lt;br /&gt;
    local Periodical = A['Periodical'];&lt;br /&gt;
&lt;br /&gt;
	local Series = A['Series'];&lt;br /&gt;
    local Volume = A['Volume'];&lt;br /&gt;
    local Issue = A['Issue'];&lt;br /&gt;
    local Position = '';&lt;br /&gt;
    local Page = A['Page'];&lt;br /&gt;
    local Pages = hyphentodash( A['Pages'] );	&lt;br /&gt;
    local At = A['At'];&lt;br /&gt;
&lt;br /&gt;
    local Edition = A['Edition'];&lt;br /&gt;
    local PublicationPlace = A['PublicationPlace']&lt;br /&gt;
    local Place = A['Place'];&lt;br /&gt;
    &lt;br /&gt;
    local PublisherName = A['PublisherName'];&lt;br /&gt;
    local RegistrationRequired = A['RegistrationRequired'];&lt;br /&gt;
    local SubscriptionRequired = A['SubscriptionRequired'];&lt;br /&gt;
    local Via = A['Via'];&lt;br /&gt;
    local AccessDate = A['AccessDate'];&lt;br /&gt;
    local ArchiveDate = A['ArchiveDate'];&lt;br /&gt;
    local Agency = A['Agency'];&lt;br /&gt;
    local DeadURL = A['DeadURL']&lt;br /&gt;
    local Language = A['Language'];&lt;br /&gt;
    local Format = A['Format'];&lt;br /&gt;
    local Ref = A['Ref'];&lt;br /&gt;
	local DoiBroken = A['DoiBroken'];&lt;br /&gt;
	local ID = A['ID'];&lt;br /&gt;
    local ASINTLD = A['ASINTLD'];&lt;br /&gt;
    local IgnoreISBN = A['IgnoreISBN'];&lt;br /&gt;
    local Embargo = A['Embargo'];&lt;br /&gt;
&lt;br /&gt;
    local ID_list = extractids( args );&lt;br /&gt;
    &lt;br /&gt;
    local Quote = A['Quote'];&lt;br /&gt;
    local PostScript = A['PostScript'];&lt;br /&gt;
&lt;br /&gt;
    local LayURL = A['LayURL'];&lt;br /&gt;
    local LaySource = A['LaySource'];&lt;br /&gt;
    local Transcript = A['Transcript'];&lt;br /&gt;
    local TranscriptURL = A['TranscriptURL'] &lt;br /&gt;
    local TranscriptURLorigin = A:ORIGIN('TranscriptURL');&lt;br /&gt;
    local sepc = A['Separator'];&lt;br /&gt;
&lt;br /&gt;
    local LastAuthorAmp = A['LastAuthorAmp'];&lt;br /&gt;
    local no_tracking_cats = A['NoTracking'];&lt;br /&gt;
&lt;br /&gt;
--these are used by cite interview&lt;br /&gt;
	local Callsign = A['Callsign'];&lt;br /&gt;
	local City = A['City'];&lt;br /&gt;
	local Cointerviewers = A['Cointerviewers'];			-- deprecated&lt;br /&gt;
	local Interviewer = A['Interviewer'];				-- deprecated&lt;br /&gt;
	local Program = A['Program'];&lt;br /&gt;
&lt;br /&gt;
--local variables that are not cs1 parameters&lt;br /&gt;
    local page_type;									-- is this needed?  Doesn't appear to be used anywhere;&lt;br /&gt;
    local use_lowercase = ( sepc ~= '.' );&lt;br /&gt;
    local this_page = mw.title.getCurrentTitle();		--Also used for COinS and for language&lt;br /&gt;
	local anchor_year;									-- used in the CITEREF identifier&lt;br /&gt;
	local COinS_date;									-- used in the COinS metadata&lt;br /&gt;
&lt;br /&gt;
-- Set postscript default.&lt;br /&gt;
	if not is_set (PostScript) then						-- if |postscript= has not been set (Postscript is nil which is the default for {{citation}}) and&lt;br /&gt;
		if (config.CitationClass ~= &amp;quot;citation&amp;quot;) then	-- this template is not a citation template&lt;br /&gt;
			PostScript = '.';							-- must be a cite xxx template so set postscript to default (period)&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		if PostScript:lower() == 'none' then			-- if |postscript=none then&lt;br /&gt;
			PostScript = '';							-- no postscript&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
--check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories.&lt;br /&gt;
	if not is_set(no_tracking_cats) then				-- ignore if we are already not going to categorize this page&lt;br /&gt;
		for k, v in pairs( cfg.uncategorized_namespaces ) do	-- otherwise, spin through the list of namespaces we don't include in error categories&lt;br /&gt;
			if this_page.nsText == v then				-- if we find one&lt;br /&gt;
				no_tracking_cats = &amp;quot;true&amp;quot;;				-- set no_trackin_cats&lt;br /&gt;
				break;									-- and we're done&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
-- check for extra |page=, |pages= or |at= parameters. &lt;br /&gt;
    if is_set(Page) then&lt;br /&gt;
        if is_set(Pages) or is_set(At) then&lt;br /&gt;
            Page = Page .. &amp;quot; &amp;quot; .. seterror('extra_pages');	-- add error message&lt;br /&gt;
            Pages = '';										-- unset the others&lt;br /&gt;
            At = '';&lt;br /&gt;
        end&lt;br /&gt;
    elseif is_set(Pages) then&lt;br /&gt;
        if is_set(At) then&lt;br /&gt;
            Pages = Pages .. &amp;quot; &amp;quot; .. seterror('extra_pages');	-- add error messages&lt;br /&gt;
            At = '';											-- unset&lt;br /&gt;
        end&lt;br /&gt;
    end    &lt;br /&gt;
&lt;br /&gt;
-- both |publication-place= and |place= (|location=) allowed if different&lt;br /&gt;
    if not is_set(PublicationPlace) and is_set(Place) then&lt;br /&gt;
        PublicationPlace = Place;							-- promote |place= (|location=) to |publication-place&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if PublicationPlace == Place then Place = ''; end		-- don't need both if they are the same&lt;br /&gt;
    &lt;br /&gt;
--[[&lt;br /&gt;
Parameter remapping for cite encyclopedia:&lt;br /&gt;
When the citation has these parameters:&lt;br /&gt;
	|encyclopedia and |title then map |title to |article and |encyclopedia to |title&lt;br /&gt;
	|encyclopedia and |article then map |encyclopedia to |title&lt;br /&gt;
	|encyclopedia then map |encyclopedia to |title&lt;br /&gt;
&lt;br /&gt;
	|trans_title maps to |trans_chapter when |title is re-mapped&lt;br /&gt;
&lt;br /&gt;
All other combinations of |encyclopedia, |title, and |article are not modified&lt;br /&gt;
]]&lt;br /&gt;
	if ( config.CitationClass == &amp;quot;encyclopaedia&amp;quot; ) then&lt;br /&gt;
		if is_set(Periodical) then					-- Periodical is set when |encyclopedia is set&lt;br /&gt;
			if is_set(Title) then&lt;br /&gt;
				if not is_set(Chapter) then&lt;br /&gt;
					Chapter = Title;				-- |encyclopedia and |title are set so map |title to |article and |encyclopedia to |title&lt;br /&gt;
					TransChapter = TransTitle;&lt;br /&gt;
					Title = Periodical;&lt;br /&gt;
					Periodical = '';				-- redundant so unset&lt;br /&gt;
					TransTitle = '';				-- redundant so unset&lt;br /&gt;
				end&lt;br /&gt;
			else									-- |title not set&lt;br /&gt;
				Title = Periodical;					-- |encyclopedia set and |article set or not set so map |encyclopedia to |title&lt;br /&gt;
				Periodical = '';					-- redundant so unset&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
--special cases for citation.&lt;br /&gt;
	if (config.CitationClass == &amp;quot;citation&amp;quot;) then		-- for citation templates&lt;br /&gt;
		if not is_set (Ref) then						-- if |ref= is not set&lt;br /&gt;
			Ref = &amp;quot;harv&amp;quot;;								-- set default |ref=harv&lt;br /&gt;
		end&lt;br /&gt;
		if not is_set (sepc) then						-- if |separator= is not set&lt;br /&gt;
			sepc = ',';									-- set citation separator to its default (comma)&lt;br /&gt;
		end&lt;br /&gt;
	else												-- not a citation template&lt;br /&gt;
		if not is_set (sepc) then						-- if |separator= has not been set&lt;br /&gt;
			sepc = '.';									-- set cite xxx separator to its default (period)&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- check for specital case where |separator=none&lt;br /&gt;
	if 'none' == sepc:lower() then						-- if |separator=none&lt;br /&gt;
		sepc = '';										-- then set it to a empty string&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- Special case for cite techreport.&lt;br /&gt;
	if (config.CitationClass == &amp;quot;techreport&amp;quot;) then	-- special case for cite techreport&lt;br /&gt;
		if is_set(Issue) then						-- cite techreport uses 'number', which other citations aliase to 'issue'&lt;br /&gt;
			if not is_set(ID) then					-- can we use ID for the &amp;quot;number&amp;quot;?&lt;br /&gt;
				ID = Issue;							-- yes, use it&lt;br /&gt;
				Issue = &amp;quot;&amp;quot;;							-- unset Issue so that &amp;quot;number&amp;quot; isn't duplicated in the rendered citation or COinS metadata&lt;br /&gt;
			else									-- can't use ID so emit error message&lt;br /&gt;
				ID = ID .. &amp;quot; &amp;quot; .. seterror('redundant_parameters', '&amp;lt;code&amp;gt;&amp;amp;#124;id=&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;#124;number=&amp;lt;/code&amp;gt;');&lt;br /&gt;
			end&lt;br /&gt;
		end	&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- special case for cite interview&lt;br /&gt;
	if (config.CitationClass == &amp;quot;interview&amp;quot;) then&lt;br /&gt;
		if is_set(Program) then&lt;br /&gt;
			ID = ' ' .. Program;&lt;br /&gt;
		end&lt;br /&gt;
		if is_set(Callsign) then&lt;br /&gt;
			if is_set(ID) then&lt;br /&gt;
				ID = ID .. sepc .. ' ' .. Callsign;&lt;br /&gt;
			else&lt;br /&gt;
				ID = ' ' .. Callsign;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		if is_set(City) then&lt;br /&gt;
			if is_set(ID) then&lt;br /&gt;
				ID = ID .. sepc .. ' ' .. City;&lt;br /&gt;
			else&lt;br /&gt;
				ID = ' ' .. City;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
		if is_set(Interviewer) then&lt;br /&gt;
			if is_set(TitleType) then&lt;br /&gt;
				Others = ' ' .. TitleType .. ' with ' .. Interviewer;&lt;br /&gt;
				TitleType = '';&lt;br /&gt;
			else&lt;br /&gt;
				Others = ' ' .. 'Interview with ' .. Interviewer;&lt;br /&gt;
			end&lt;br /&gt;
			if is_set(Cointerviewers) then&lt;br /&gt;
				Others = Others .. sepc .. ' ' .. Cointerviewers;&lt;br /&gt;
			end&lt;br /&gt;
		else&lt;br /&gt;
			Others = '(Interview)';&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
--Account for the oddity that is {{cite journal}} with |pmc= set and |url= not set&lt;br /&gt;
	if config.CitationClass == &amp;quot;journal&amp;quot; and not is_set(URL) and is_set(ID_list['PMC']) then&lt;br /&gt;
		if not is_embargoed(Embargo) then&lt;br /&gt;
			URL=cfg.id_handlers['PMC'].prefix .. ID_list['PMC'];	-- set url to be the same as the PMC external link if not embargoed&lt;br /&gt;
			URLorigin = cfg.id_handlers['PMC'].parameters[1];		-- set URLorigin to parameter name for use in error message if citation is missing a |title=&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.&lt;br /&gt;
--TODO: if this is only for {{cite conference}}, shouldn't we be checking? (if config.CitationClass=='conference' then ...)&lt;br /&gt;
	if is_set(BookTitle) then&lt;br /&gt;
		Chapter = Title;&lt;br /&gt;
		ChapterLink = TitleLink;&lt;br /&gt;
		TransChapter = TransTitle;&lt;br /&gt;
		Title = BookTitle;&lt;br /&gt;
		TitleLink = '';&lt;br /&gt;
		TransTitle = '';&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- Account for the oddity that is {{cite episode}}, before generation of COinS data.&lt;br /&gt;
--[[	-- {{cite episode}} is not currently supported by this module&lt;br /&gt;
	if config.CitationClass == &amp;quot;episode&amp;quot; then&lt;br /&gt;
		local AirDate = A['AirDate'];&lt;br /&gt;
		local SeriesLink = A['SeriesLink'];&lt;br /&gt;
		local Season = A['Season'];&lt;br /&gt;
		local SeriesNumber = A['SeriesNumber'];&lt;br /&gt;
		local Network = A['Network'];&lt;br /&gt;
		local Station = A['Station'];&lt;br /&gt;
		local s, n = {}, {};&lt;br /&gt;
		local Sep = (first_set(A[&amp;quot;SeriesSeparator&amp;quot;], A[&amp;quot;Separator&amp;quot;]) or &amp;quot;&amp;quot;) .. &amp;quot; &amp;quot;;&lt;br /&gt;
		&lt;br /&gt;
		if is_set(Issue) then table.insert(s, cfg.messages[&amp;quot;episode&amp;quot;] .. &amp;quot; &amp;quot; .. Issue); Issue = ''; end&lt;br /&gt;
		if is_set(Season) then table.insert(s, cfg.messages[&amp;quot;season&amp;quot;] .. &amp;quot; &amp;quot; .. Season); end&lt;br /&gt;
		if is_set(SeriesNumber) then table.insert(s, cfg.messages[&amp;quot;series&amp;quot;] .. &amp;quot; &amp;quot; .. SeriesNumber); end&lt;br /&gt;
		if is_set(Network) then table.insert(n, Network); end&lt;br /&gt;
		if is_set(Station) then table.insert(n, Station); end&lt;br /&gt;
		&lt;br /&gt;
		Date = Date or AirDate;&lt;br /&gt;
		Chapter = Title;&lt;br /&gt;
		ChapterLink = TitleLink;&lt;br /&gt;
		TransChapter = TransTitle;&lt;br /&gt;
		Title = Series;&lt;br /&gt;
		TitleLink = SeriesLink;&lt;br /&gt;
		TransTitle = '';&lt;br /&gt;
		&lt;br /&gt;
		Series = table.concat(s, Sep);&lt;br /&gt;
		ID = table.concat(n, Sep);&lt;br /&gt;
	end&lt;br /&gt;
-- end of {{cite episode}} stuff]]&lt;br /&gt;
&lt;br /&gt;
-- legacy: promote concatenation of |day=, |month=, and |year= to Date if Date not set; or, promote PublicationDate to Date if neither Date nor Year are set.&lt;br /&gt;
	if not is_set(Date) then&lt;br /&gt;
		Date = Year;						-- promote Year to Date&lt;br /&gt;
		Year = nil;							-- make nil so Year as empty string isn't used for CITEREF&lt;br /&gt;
		if is_set(Date) then&lt;br /&gt;
			local Month = A['Month'];&lt;br /&gt;
			if is_set(Month) then&lt;br /&gt;
				Date = Month .. &amp;quot; &amp;quot; .. Date;&lt;br /&gt;
				local Day = A['Day']&lt;br /&gt;
				if is_set(Day) then Date = Day .. &amp;quot; &amp;quot; .. Date end&lt;br /&gt;
			end&lt;br /&gt;
		elseif is_set(PublicationDate) then	-- use PublicationDate when |date= and |year= are not set&lt;br /&gt;
			Date = PublicationDate;			-- promonte PublicationDate to Date&lt;br /&gt;
			PublicationDate = '';			-- unset, no longer needed&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if PublicationDate == Date then PublicationDate = ''; end	-- if PublicationDate is same as Date, don't display in rendered citation&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Go test all of the date-holding parameters for valid MOS:DATE format and make sure that dates are real dates. This must be done before we do COinS because here is where&lt;br /&gt;
we get the date used in the metadata.&lt;br /&gt;
&lt;br /&gt;
Date validation supporting code is in Module:Citation/CS1/Date_validation&lt;br /&gt;
]]&lt;br /&gt;
	anchor_year, COinS_date, error_message = dates({['accessdate']=AccessDate, ['airdate']=AirDate, ['archivedate']=ArchiveDate, ['date']=Date, ['doi_brokendate']=DoiBroken,&lt;br /&gt;
		['embargo']=Embargo, ['laydate']=LayDate, ['publicationdate']=PublicationDate, ['year']=Year});&lt;br /&gt;
	if is_set(error_message) then&lt;br /&gt;
		table.insert( z.message_tail, { seterror( 'bad_date', {error_message}, true ) } );	-- add this error message&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
-- At this point fields may be nil if they weren't specified in the template use.  We can use that fact.&lt;br /&gt;
&lt;br /&gt;
    -- COinS metadata (see &amp;lt;http://ocoins.info/&amp;gt;) for&lt;br /&gt;
    -- automated parsing of citation information.&lt;br /&gt;
    local OCinSoutput = COinS{&lt;br /&gt;
        ['Periodical'] = Periodical,&lt;br /&gt;
        ['Chapter'] = Chapter,&lt;br /&gt;
        ['Title'] = Title,&lt;br /&gt;
        ['PublicationPlace'] = PublicationPlace,&lt;br /&gt;
        ['Date'] = first_set(COinS_date, Date),		-- COinS_date has correctly formatted date if Date is valid; any reason to keep Date here?  Should we be including invalid dates in metadata?&lt;br /&gt;
        ['Series'] = Series,&lt;br /&gt;
        ['Volume'] = Volume,&lt;br /&gt;
        ['Issue'] = Issue,&lt;br /&gt;
        ['Pages'] = get_coins_pages (first_set(Page, Pages, At)),	-- pages stripped of external links&lt;br /&gt;
        ['Edition'] = Edition,&lt;br /&gt;
        ['PublisherName'] = PublisherName,&lt;br /&gt;
        ['URL'] = first_set( URL, ChapterURL ),&lt;br /&gt;
        ['Authors'] = a,&lt;br /&gt;
        ['ID_list'] = ID_list,&lt;br /&gt;
        ['RawPage'] = this_page.prefixedText,&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    if is_set(Periodical) and not is_set(Chapter) and is_set(Title) then&lt;br /&gt;
        Chapter = Title;&lt;br /&gt;
        ChapterLink = TitleLink;&lt;br /&gt;
        TransChapter = TransTitle;&lt;br /&gt;
        Title = '';&lt;br /&gt;
        TitleLink = '';&lt;br /&gt;
        TransTitle = '';&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    -- Now perform various field substitutions.&lt;br /&gt;
    -- We also add leading spaces and surrounding markup and punctuation to the&lt;br /&gt;
    -- various parts of the citation, but only when they are non-nil.&lt;br /&gt;
    if not is_set(Authors) then&lt;br /&gt;
        local Maximum = tonumber( A['DisplayAuthors'] );&lt;br /&gt;
        &lt;br /&gt;
        -- Preserve old-style implicit et al.&lt;br /&gt;
        if not is_set(Maximum) and #a == 9 then &lt;br /&gt;
            Maximum = 8;&lt;br /&gt;
            table.insert( z.message_tail, { seterror('implict_etal_author', {}, true ) } );&lt;br /&gt;
        elseif not is_set(Maximum) then&lt;br /&gt;
            Maximum = #a + 1;&lt;br /&gt;
        end&lt;br /&gt;
            &lt;br /&gt;
        local control = { &lt;br /&gt;
            sep = A[&amp;quot;AuthorSeparator&amp;quot;] .. &amp;quot; &amp;quot;,&lt;br /&gt;
            namesep = (first_set(A[&amp;quot;AuthorNameSeparator&amp;quot;], A[&amp;quot;NameSeparator&amp;quot;]) or &amp;quot;&amp;quot;) .. &amp;quot; &amp;quot;,&lt;br /&gt;
            format = A[&amp;quot;AuthorFormat&amp;quot;],&lt;br /&gt;
            maximum = Maximum,&lt;br /&gt;
            lastauthoramp = LastAuthorAmp&lt;br /&gt;
        };&lt;br /&gt;
        &lt;br /&gt;
        -- If the coauthor field is also used, prevent ampersand and et al. formatting.&lt;br /&gt;
        if is_set(Coauthors) then&lt;br /&gt;
            control.lastauthoramp = nil;&lt;br /&gt;
            control.maximum = #a + 1;&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        Authors = listpeople(control, a) &lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
	if not is_set(Authors) and is_set(Coauthors) then	-- coauthors aren't displayed if one of authors=, authorn=, or lastn= isn't specified&lt;br /&gt;
		table.insert( z.message_tail, { seterror('coauthors_missing_author', {}, true) } );	-- emit error message&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
    local EditorCount&lt;br /&gt;
    if not is_set(Editors) then&lt;br /&gt;
        local Maximum = tonumber( A['DisplayEditors'] );&lt;br /&gt;
        -- Preserve old-style implicit et al.&lt;br /&gt;
        if not is_set(Maximum) and #e == 4 then &lt;br /&gt;
            Maximum = 3;&lt;br /&gt;
            table.insert( z.message_tail, { seterror('implict_etal_editor', {}, true) } );&lt;br /&gt;
        elseif not is_set(Maximum) then&lt;br /&gt;
            Maximum = #e + 1;&lt;br /&gt;
        end&lt;br /&gt;
&lt;br /&gt;
        local control = { &lt;br /&gt;
            sep = A[&amp;quot;EditorSeparator&amp;quot;] .. &amp;quot; &amp;quot;,&lt;br /&gt;
            namesep = (first_set(A[&amp;quot;EditorNameSeparator&amp;quot;], A[&amp;quot;NameSeparator&amp;quot;]) or &amp;quot;&amp;quot;) .. &amp;quot; &amp;quot;,&lt;br /&gt;
            format = A['EditorFormat'],&lt;br /&gt;
            maximum = Maximum,&lt;br /&gt;
            lastauthoramp = LastAuthorAmp&lt;br /&gt;
        };&lt;br /&gt;
&lt;br /&gt;
        Editors, EditorCount = listpeople(control, e);&lt;br /&gt;
    else&lt;br /&gt;
        EditorCount = 1;&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    local Cartography = &amp;quot;&amp;quot;;&lt;br /&gt;
    local Scale = &amp;quot;&amp;quot;;&lt;br /&gt;
    if config.CitationClass == &amp;quot;map&amp;quot; then&lt;br /&gt;
        if not is_set( Authors ) and is_set( PublisherName ) then&lt;br /&gt;
            Authors = PublisherName;&lt;br /&gt;
            PublisherName = &amp;quot;&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
        Cartography = A['Cartography'];&lt;br /&gt;
        if is_set( Cartography ) then&lt;br /&gt;
            Cartography = sepc .. &amp;quot; &amp;quot; .. wrap( 'cartography', Cartography, use_lowercase );&lt;br /&gt;
        end        &lt;br /&gt;
        Scale = A['Scale'];&lt;br /&gt;
        if is_set( Scale ) then&lt;br /&gt;
            Scale = sepc .. &amp;quot; &amp;quot; .. Scale;&lt;br /&gt;
        end        &lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if  not is_set(URL) and&lt;br /&gt;
        not is_set(ChapterURL) and&lt;br /&gt;
        not is_set(ArchiveURL) and&lt;br /&gt;
        not is_set(ConferenceURL) and&lt;br /&gt;
        not is_set(TranscriptURL) then&lt;br /&gt;
        &lt;br /&gt;
        -- Test if cite web or cite podcast |url= is missing or empty &lt;br /&gt;
		if inArray(config.CitationClass, {&amp;quot;web&amp;quot;,&amp;quot;podcast&amp;quot;}) then	&lt;br /&gt;
			table.insert( z.message_tail, { seterror( 'cite_web_url', {}, true ) } );&lt;br /&gt;
		end&lt;br /&gt;
        &lt;br /&gt;
        -- Test if accessdate is given without giving a URL&lt;br /&gt;
        if is_set(AccessDate) then&lt;br /&gt;
            table.insert( z.message_tail, { seterror( 'accessdate_missing_url', {}, true ) } );&lt;br /&gt;
            AccessDate = '';&lt;br /&gt;
        end&lt;br /&gt;
        &lt;br /&gt;
        -- Test if format is given without giving a URL&lt;br /&gt;
        if is_set(Format) then&lt;br /&gt;
            Format = Format .. seterror( 'format_missing_url' );&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Test if citation has no title&lt;br /&gt;
    if  not is_set(Chapter) and&lt;br /&gt;
        not is_set(Title) and&lt;br /&gt;
        not is_set(Periodical) and&lt;br /&gt;
        not is_set(Conference) and&lt;br /&gt;
        not is_set(TransTitle) and&lt;br /&gt;
        not is_set(TransChapter) then&lt;br /&gt;
        table.insert( z.message_tail, { seterror( 'citation_missing_title', {}, true ) } );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    Format = is_set(Format) and &amp;quot; (&amp;quot; .. Format .. &amp;quot;)&amp;quot; or &amp;quot;&amp;quot;;&lt;br /&gt;
    &lt;br /&gt;
    local OriginalURL = URL&lt;br /&gt;
    DeadURL = DeadURL:lower();&lt;br /&gt;
    if is_set( ArchiveURL ) then&lt;br /&gt;
        if ( DeadURL ~= &amp;quot;no&amp;quot; ) then&lt;br /&gt;
            URL = ArchiveURL&lt;br /&gt;
            URLorigin = A:ORIGIN('ArchiveURL')&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Format chapter / article title&lt;br /&gt;
    if is_set(Chapter) and is_set(ChapterLink) then &lt;br /&gt;
        Chapter = &amp;quot;[[&amp;quot; .. ChapterLink .. &amp;quot;|&amp;quot; .. Chapter .. &amp;quot;]]&amp;quot;;&lt;br /&gt;
    end&lt;br /&gt;
    if is_set(Periodical) and is_set(Title) then&lt;br /&gt;
        Chapter = wrap( 'italic-title', Chapter );&lt;br /&gt;
        TransChapter = wrap( 'trans-italic-title', TransChapter );&lt;br /&gt;
    else&lt;br /&gt;
		Chapter = kern_quotes (Chapter);				-- if necessary, separate chapter title's leading and trailing quote marks from Module provided quote marks&lt;br /&gt;
        Chapter = wrap( 'quoted-title', Chapter );&lt;br /&gt;
        TransChapter = wrap( 'trans-quoted-title', TransChapter );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local TransError = &amp;quot;&amp;quot;&lt;br /&gt;
    if is_set(TransChapter) then&lt;br /&gt;
        if not is_set(Chapter) then&lt;br /&gt;
            TransError = &amp;quot; &amp;quot; .. seterror( 'trans_missing_chapter' );&lt;br /&gt;
        else&lt;br /&gt;
            TransChapter = &amp;quot; &amp;quot; .. TransChapter;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    Chapter = Chapter .. TransChapter;&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Chapter) then&lt;br /&gt;
        if not is_set(ChapterLink) then&lt;br /&gt;
            if is_set(ChapterURL) then&lt;br /&gt;
                Chapter = externallink( ChapterURL, Chapter ) .. TransError;&lt;br /&gt;
                if not is_set(URL) then&lt;br /&gt;
                    Chapter = Chapter .. Format;&lt;br /&gt;
                    Format = &amp;quot;&amp;quot;;&lt;br /&gt;
                end&lt;br /&gt;
            elseif is_set(URL) then &lt;br /&gt;
                Chapter = externallink( URL, Chapter ) .. TransError .. Format;&lt;br /&gt;
                URL = &amp;quot;&amp;quot;;&lt;br /&gt;
                Format = &amp;quot;&amp;quot;;&lt;br /&gt;
            else&lt;br /&gt;
                Chapter = Chapter .. TransError;&lt;br /&gt;
            end            &lt;br /&gt;
        elseif is_set(ChapterURL) then&lt;br /&gt;
            Chapter = Chapter .. &amp;quot; &amp;quot; .. externallink( ChapterURL, nil, ChapterURLorigin ) .. &lt;br /&gt;
                TransError;&lt;br /&gt;
        else&lt;br /&gt;
            Chapter = Chapter .. TransError;&lt;br /&gt;
        end&lt;br /&gt;
        Chapter = Chapter .. sepc .. &amp;quot; &amp;quot; -- with end-space&lt;br /&gt;
    elseif is_set(ChapterURL) then&lt;br /&gt;
        Chapter = &amp;quot; &amp;quot; .. externallink( ChapterURL, nil, ChapterURLorigin ) .. sepc .. &amp;quot; &amp;quot;;&lt;br /&gt;
    end        &lt;br /&gt;
    &lt;br /&gt;
    -- Format main title.&lt;br /&gt;
    if is_set(TitleLink) and is_set(Title) then&lt;br /&gt;
        Title = &amp;quot;[[&amp;quot; .. TitleLink .. &amp;quot;|&amp;quot; .. Title .. &amp;quot;]]&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Periodical) then&lt;br /&gt;
		Title = kern_quotes (Title);				-- if necessary, separate title's leading and trailing quote marks from Module provided quote marks&lt;br /&gt;
        Title = wrap( 'quoted-title', Title );&lt;br /&gt;
        TransTitle = wrap( 'trans-quoted-title', TransTitle );&lt;br /&gt;
    elseif inArray(config.CitationClass, {&amp;quot;web&amp;quot;,&amp;quot;news&amp;quot;,&amp;quot;pressrelease&amp;quot;,&amp;quot;conference&amp;quot;,&amp;quot;podcast&amp;quot;}) and&lt;br /&gt;
            not is_set(Chapter) then&lt;br /&gt;
		Title = kern_quotes (Title);				-- if necessary, separate title's leading and trailing quote marks from Module provided quote marks&lt;br /&gt;
        Title = wrap( 'quoted-title', Title );&lt;br /&gt;
        TransTitle = wrap( 'trans-quoted-title', TransTitle );&lt;br /&gt;
    else&lt;br /&gt;
        Title = wrap( 'italic-title', Title );&lt;br /&gt;
        TransTitle = wrap( 'trans-italic-title', TransTitle );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    TransError = &amp;quot;&amp;quot;;&lt;br /&gt;
    if is_set(TransTitle) then&lt;br /&gt;
        if not is_set(Title) then&lt;br /&gt;
            TransError = &amp;quot; &amp;quot; .. seterror( 'trans_missing_title' );&lt;br /&gt;
        else&lt;br /&gt;
            TransTitle = &amp;quot; &amp;quot; .. TransTitle;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    Title = Title .. TransTitle;&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Title) then&lt;br /&gt;
        if not is_set(TitleLink) and is_set(URL) then &lt;br /&gt;
            Title = externallink( URL, Title ) .. TransError .. Format       &lt;br /&gt;
            URL = &amp;quot;&amp;quot;;&lt;br /&gt;
            Format = &amp;quot;&amp;quot;;&lt;br /&gt;
        else&lt;br /&gt;
            Title = Title .. TransError;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Place) then&lt;br /&gt;
        Place = &amp;quot; &amp;quot; .. wrap( 'written', Place, use_lowercase ) .. sepc .. &amp;quot; &amp;quot;;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Conference) then&lt;br /&gt;
        if is_set(ConferenceURL) then&lt;br /&gt;
            Conference = externallink( ConferenceURL, Conference );&lt;br /&gt;
        end&lt;br /&gt;
        Conference = sepc .. &amp;quot; &amp;quot; .. Conference&lt;br /&gt;
    elseif is_set(ConferenceURL) then&lt;br /&gt;
        Conference = sepc .. &amp;quot; &amp;quot; .. externallink( ConferenceURL, nil, ConferenceURLorigin );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if not is_set(Position) then&lt;br /&gt;
        local Minutes = A['Minutes'];&lt;br /&gt;
        if is_set(Minutes) then&lt;br /&gt;
            Position = &amp;quot; &amp;quot; .. Minutes .. &amp;quot; &amp;quot; .. cfg.messages['minutes'];&lt;br /&gt;
        else&lt;br /&gt;
            local Time = A['Time'];&lt;br /&gt;
            if is_set(Time) then&lt;br /&gt;
                local TimeCaption = A['TimeCaption']&lt;br /&gt;
                if not is_set(TimeCaption) then&lt;br /&gt;
                    TimeCaption = cfg.messages['event'];&lt;br /&gt;
                    if sepc ~= '.' then&lt;br /&gt;
                        TimeCaption = TimeCaption:lower();&lt;br /&gt;
                    end&lt;br /&gt;
                end&lt;br /&gt;
                Position = &amp;quot; &amp;quot; .. TimeCaption .. &amp;quot; &amp;quot; .. Time;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        Position = &amp;quot; &amp;quot; .. Position;&lt;br /&gt;
        At = '';&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if not is_set(Page) then&lt;br /&gt;
        if is_set(Pages) then&lt;br /&gt;
            if is_set(Periodical) and&lt;br /&gt;
                not inArray(config.CitationClass, {&amp;quot;encyclopaedia&amp;quot;,&amp;quot;web&amp;quot;,&amp;quot;book&amp;quot;,&amp;quot;news&amp;quot;,&amp;quot;podcast&amp;quot;}) then&lt;br /&gt;
                Pages = &amp;quot;: &amp;quot; .. Pages;&lt;br /&gt;
            elseif tonumber(Pages) ~= nil then&lt;br /&gt;
                Pages = sepc ..&amp;quot; &amp;quot; .. PPrefix .. Pages;&lt;br /&gt;
            else&lt;br /&gt;
                Pages = sepc ..&amp;quot; &amp;quot; .. PPPrefix .. Pages;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if is_set(Periodical) and&lt;br /&gt;
            not inArray(config.CitationClass, {&amp;quot;encyclopaedia&amp;quot;,&amp;quot;web&amp;quot;,&amp;quot;book&amp;quot;,&amp;quot;news&amp;quot;,&amp;quot;podcast&amp;quot;}) then&lt;br /&gt;
            Page = &amp;quot;: &amp;quot; .. Page;&lt;br /&gt;
        else&lt;br /&gt;
            Page = sepc ..&amp;quot; &amp;quot; .. PPrefix .. Page;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    At = is_set(At) and (sepc .. &amp;quot; &amp;quot; .. At) or &amp;quot;&amp;quot;;&lt;br /&gt;
    Position = is_set(Position) and (sepc .. &amp;quot; &amp;quot; .. Position) or &amp;quot;&amp;quot;;&lt;br /&gt;
    if config.CitationClass == 'map' then&lt;br /&gt;
        local Section = A['Section'];&lt;br /&gt;
        local Inset = A['Inset'];&lt;br /&gt;
        if first_set( Pages, Page, At ) ~= nil or sepc ~= '.' then&lt;br /&gt;
            if is_set( Section ) then&lt;br /&gt;
                Section = &amp;quot;, &amp;quot; .. wrap( 'section', Section, true );&lt;br /&gt;
            end&lt;br /&gt;
            if is_set( Inset ) then&lt;br /&gt;
                Inset = &amp;quot;, &amp;quot; .. wrap( 'inset', Inset, true );&lt;br /&gt;
            end&lt;br /&gt;
        else&lt;br /&gt;
            if is_set( Section ) then&lt;br /&gt;
                Section = sepc .. &amp;quot; &amp;quot; .. wrap( 'section', Section, use_lowercase );&lt;br /&gt;
                if is_set( Inset ) then&lt;br /&gt;
                    Inset = &amp;quot;, &amp;quot; .. wrap( 'inset', Inset, true );&lt;br /&gt;
                end&lt;br /&gt;
            elseif is_set( Inset ) then&lt;br /&gt;
                Inset = sepc .. &amp;quot; &amp;quot; .. wrap( 'inset', Inset, use_lowercase );&lt;br /&gt;
            end            &lt;br /&gt;
        end            &lt;br /&gt;
        At = At .. Section .. Inset;        &lt;br /&gt;
    end    &lt;br /&gt;
&lt;br /&gt;
	--[[Look in the list of iso639-1 language codes to see if the value provided in the language parameter matches one of them.  If a match is found, &lt;br /&gt;
	use that value; if not, then use the value that was provided with the language parameter.&lt;br /&gt;
	&lt;br /&gt;
	Categories are assigned in a manner similar to the {{xx icon}} templates - categorizes only mainspace citations and only when the language code is not 'en' (English).&lt;br /&gt;
	]]&lt;br /&gt;
	if is_set (Language) then&lt;br /&gt;
--		local name = mw.language.fetchLanguageName( Language:lower(), &amp;quot;en&amp;quot; );	-- experiment: this seems to return correct ISO 639-1 language names&lt;br /&gt;
		local name = cfg.iso639_1[Language:lower()];		-- get the language name if Language parameter has a valid iso 639-1 code&lt;br /&gt;
		if nil == name then&lt;br /&gt;
			Language=&amp;quot; &amp;quot; .. wrap( 'language', Language );	-- no match, use parameter's value&lt;br /&gt;
		else&lt;br /&gt;
			if 0 == this_page.namespace and 'en' ~= Language:lower() then	--found a match; is this page main / article space and English not the language?&lt;br /&gt;
				Language=&amp;quot; &amp;quot; .. wrap( 'language', name .. '[[Category:Articles with ' .. name .. '-language external links]]' );	-- in main space and not English: categorize&lt;br /&gt;
			else&lt;br /&gt;
				Language=&amp;quot; &amp;quot; .. wrap( 'language', name );	--not in mainspace or language is English so don't categorize&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		Language=&amp;quot;&amp;quot;;	-- language not specified so make sure this is an empty string;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	Others = is_set(Others) and (sepc .. &amp;quot; &amp;quot; .. Others) or &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
-- handle type parameter for those CS1 citations that have default values&lt;br /&gt;
&lt;br /&gt;
	if inArray(config.CitationClass, {&amp;quot;AV media notes&amp;quot;, &amp;quot;DVD notes&amp;quot;, &amp;quot;podcast&amp;quot;, &amp;quot;pressrelease&amp;quot;, &amp;quot;techreport&amp;quot;, &amp;quot;thesis&amp;quot;}) then&lt;br /&gt;
		TitleType = set_titletype (config.CitationClass, TitleType);&lt;br /&gt;
		if is_set(Degree) and &amp;quot;Thesis&amp;quot; == TitleType then	-- special case for cite thesis&lt;br /&gt;
			TitleType = Degree .. &amp;quot; thesis&amp;quot;;&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if is_set(TitleType) then					-- if type parameter is specified&lt;br /&gt;
		TitleType = &amp;quot; (&amp;quot; .. TitleType .. &amp;quot;)&amp;quot;;	-- display it in parentheses&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	TitleNote = is_set(TitleNote) and (sepc .. &amp;quot; &amp;quot; .. TitleNote) or &amp;quot;&amp;quot;;&lt;br /&gt;
    Edition = is_set(Edition) and (&amp;quot; &amp;quot; .. wrap( 'edition', Edition )) or &amp;quot;&amp;quot;;&lt;br /&gt;
    Issue = is_set(Issue) and (&amp;quot; (&amp;quot; .. Issue .. &amp;quot;)&amp;quot;) or &amp;quot;&amp;quot;;&lt;br /&gt;
    Series = is_set(Series) and (sepc .. &amp;quot; &amp;quot; .. Series) or &amp;quot;&amp;quot;;&lt;br /&gt;
    OrigYear = is_set(OrigYear) and (&amp;quot; [&amp;quot; .. OrigYear .. &amp;quot;]&amp;quot;) or &amp;quot;&amp;quot;;&lt;br /&gt;
    Agency = is_set(Agency) and (sepc .. &amp;quot; &amp;quot; .. Agency) or &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    if is_set(Volume) then&lt;br /&gt;
        if ( mw.ustring.len(Volume) &amp;gt; 4 )&lt;br /&gt;
          then Volume = sepc ..&amp;quot; &amp;quot; .. Volume;&lt;br /&gt;
          else Volume = &amp;quot; &amp;lt;b&amp;gt;&amp;quot; .. hyphentodash(Volume) .. &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
--[[ This code commented out while discussion continues until after week of 2014-03-23 live module update;&lt;br /&gt;
    if is_set(Volume) then&lt;br /&gt;
        if ( mw.ustring.len(Volume) &amp;gt; 4 )&lt;br /&gt;
          then Volume = sepc .. &amp;quot; &amp;quot; .. Volume;&lt;br /&gt;
          else&lt;br /&gt;
              Volume = &amp;quot; &amp;lt;b&amp;gt;&amp;quot; .. hyphentodash(Volume) .. &amp;quot;&amp;lt;/b&amp;gt;&amp;quot;;&lt;br /&gt;
              if is_set(Series) then Volume = sepc .. Volume;&lt;br /&gt;
              end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
]]    &lt;br /&gt;
    ------------------------------------ totally unrelated data&lt;br /&gt;
    --[[ Loosely mimic {{subscription required}} template; Via parameter identifies a delivery source that is not the publisher; these sources often, but not always, exist&lt;br /&gt;
    behind a registration or paywall.  So here, we've chosen to decouple via from subscription (via has never been part of the registration required template).&lt;br /&gt;
    &lt;br /&gt;
    Subscription implies paywall; Registration does not.  If both are used in a citation, the subscription required link note is displayed. There are no error messages for this condition.&lt;br /&gt;
    ]]&lt;br /&gt;
    if is_set(Via) then&lt;br /&gt;
        Via = &amp;quot; &amp;quot; .. wrap( 'via', Via );&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
	if is_set(SubscriptionRequired) then&lt;br /&gt;
        SubscriptionRequired = sepc .. &amp;quot; &amp;quot; .. cfg.messages['subscription']; --here when 'via' parameter not used but 'subscription' is&lt;br /&gt;
    elseif is_set(RegistrationRequired) then&lt;br /&gt;
        SubscriptionRequired = sepc .. &amp;quot; &amp;quot; .. cfg.messages['registration']; --here when 'via' and 'subscription' parameters not used but 'registration' is&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if is_set(AccessDate) then&lt;br /&gt;
        local retrv_text = &amp;quot; &amp;quot; .. cfg.messages['retrieved']&lt;br /&gt;
        if (sepc ~= &amp;quot;.&amp;quot;) then retrv_text = retrv_text:lower() end&lt;br /&gt;
        AccessDate = '&amp;lt;span class=&amp;quot;reference-accessdate&amp;quot;&amp;gt;' .. sepc&lt;br /&gt;
            .. substitute( retrv_text, {AccessDate} ) .. '&amp;lt;/span&amp;gt;'&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(ID) then ID = sepc ..&amp;quot; &amp;quot;.. ID; end&lt;br /&gt;
   	if &amp;quot;thesis&amp;quot; == config.CitationClass and is_set(Docket) then&lt;br /&gt;
		ID = sepc ..&amp;quot; Docket &amp;quot;.. Docket .. ID;&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
    &lt;br /&gt;
    ID_list = buildidlist( ID_list, {DoiBroken = DoiBroken, ASINTLD = ASINTLD, IgnoreISBN = IgnoreISBN, Embargo=Embargo} );&lt;br /&gt;
&lt;br /&gt;
    if is_set(URL) then&lt;br /&gt;
        URL = &amp;quot; &amp;quot; .. externallink( URL, nil, URLorigin );&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    if is_set(Quote) then&lt;br /&gt;
        if Quote:sub(1,1) == '&amp;quot;' and Quote:sub(-1,-1) == '&amp;quot;' then&lt;br /&gt;
            Quote = Quote:sub(2,-2);&lt;br /&gt;
        end&lt;br /&gt;
        Quote = sepc ..&amp;quot; &amp;quot; .. wrap( 'quoted-text', Quote ); &lt;br /&gt;
        PostScript = &amp;quot;&amp;quot;;							-- CS1 does not supply terminal punctuation when |quote= is set&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local Archived&lt;br /&gt;
    if is_set(ArchiveURL) then&lt;br /&gt;
        if not is_set(ArchiveDate) then&lt;br /&gt;
            ArchiveDate = seterror('archive_missing_date');&lt;br /&gt;
        end&lt;br /&gt;
        if &amp;quot;no&amp;quot; == DeadURL then&lt;br /&gt;
            local arch_text = cfg.messages['archived'];&lt;br /&gt;
            if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
            Archived = sepc .. &amp;quot; &amp;quot; .. substitute( cfg.messages['archived-not-dead'],&lt;br /&gt;
                { externallink( ArchiveURL, arch_text ), ArchiveDate } );&lt;br /&gt;
            if not is_set(OriginalURL) then&lt;br /&gt;
                Archived = Archived .. &amp;quot; &amp;quot; .. seterror('archive_missing_url');                               &lt;br /&gt;
            end&lt;br /&gt;
        elseif is_set(OriginalURL) then&lt;br /&gt;
            local arch_text = cfg.messages['archived-dead'];&lt;br /&gt;
            if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
            Archived = sepc .. &amp;quot; &amp;quot; .. substitute( arch_text,&lt;br /&gt;
                { externallink( OriginalURL, cfg.messages['original'] ), ArchiveDate } );&lt;br /&gt;
        else&lt;br /&gt;
            local arch_text = cfg.messages['archived-missing'];&lt;br /&gt;
            if sepc ~= &amp;quot;.&amp;quot; then arch_text = arch_text:lower() end&lt;br /&gt;
            Archived = sepc .. &amp;quot; &amp;quot; .. substitute( arch_text, &lt;br /&gt;
                { seterror('archive_missing_url'), ArchiveDate } );&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        Archived = &amp;quot;&amp;quot;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local Lay&lt;br /&gt;
    if is_set(LayURL) then&lt;br /&gt;
        if is_set(LayDate) then LayDate = &amp;quot; (&amp;quot; .. LayDate .. &amp;quot;)&amp;quot; end&lt;br /&gt;
        if is_set(LaySource) then &lt;br /&gt;
            LaySource = &amp;quot; &amp;amp;ndash; ''&amp;quot; .. safeforitalics(LaySource) .. &amp;quot;''&amp;quot;;&lt;br /&gt;
        else&lt;br /&gt;
            LaySource = &amp;quot;&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
        if sepc == '.' then&lt;br /&gt;
            Lay = sepc .. &amp;quot; &amp;quot; .. externallink( LayURL, cfg.messages['lay summary'] ) .. LaySource .. LayDate&lt;br /&gt;
        else&lt;br /&gt;
            Lay = sepc .. &amp;quot; &amp;quot; .. externallink( LayURL, cfg.messages['lay summary']:lower() ) .. LaySource .. LayDate&lt;br /&gt;
        end            &lt;br /&gt;
    else&lt;br /&gt;
        Lay = &amp;quot;&amp;quot;;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Transcript) then&lt;br /&gt;
        if is_set(TranscriptURL) then Transcript = externallink( TranscriptURL, Transcript ); end&lt;br /&gt;
    elseif is_set(TranscriptURL) then&lt;br /&gt;
        Transcript = externallink( TranscriptURL, nil, TranscriptURLorigin );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local Publisher;&lt;br /&gt;
    if is_set(Periodical) and&lt;br /&gt;
        not inArray(config.CitationClass, {&amp;quot;encyclopaedia&amp;quot;,&amp;quot;web&amp;quot;,&amp;quot;pressrelease&amp;quot;,&amp;quot;podcast&amp;quot;}) then&lt;br /&gt;
        if is_set(PublisherName) then&lt;br /&gt;
            if is_set(PublicationPlace) then&lt;br /&gt;
                Publisher = PublicationPlace .. &amp;quot;: &amp;quot; .. PublisherName;&lt;br /&gt;
            else&lt;br /&gt;
                Publisher = PublisherName;  &lt;br /&gt;
            end&lt;br /&gt;
        elseif is_set(PublicationPlace) then&lt;br /&gt;
            Publisher= PublicationPlace;&lt;br /&gt;
        else &lt;br /&gt;
            Publisher = &amp;quot;&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(PublicationDate) then&lt;br /&gt;
            if is_set(Publisher) then&lt;br /&gt;
                Publisher = Publisher .. &amp;quot;, &amp;quot; .. wrap( 'published', PublicationDate );&lt;br /&gt;
            else&lt;br /&gt;
                Publisher = PublicationDate;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(Publisher) then&lt;br /&gt;
            Publisher = &amp;quot; (&amp;quot; .. Publisher .. &amp;quot;)&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
    else&lt;br /&gt;
        if is_set(PublicationDate) then&lt;br /&gt;
            PublicationDate = &amp;quot; (&amp;quot; .. wrap( 'published', PublicationDate ) .. &amp;quot;)&amp;quot;;&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(PublisherName) then&lt;br /&gt;
            if is_set(PublicationPlace) then&lt;br /&gt;
                Publisher = sepc .. &amp;quot; &amp;quot; .. PublicationPlace .. &amp;quot;: &amp;quot; .. PublisherName .. PublicationDate;&lt;br /&gt;
            else&lt;br /&gt;
                Publisher = sepc .. &amp;quot; &amp;quot; .. PublisherName .. PublicationDate;  &lt;br /&gt;
            end            &lt;br /&gt;
        elseif is_set(PublicationPlace) then &lt;br /&gt;
            Publisher= sepc .. &amp;quot; &amp;quot; .. PublicationPlace .. PublicationDate;&lt;br /&gt;
        else &lt;br /&gt;
            Publisher = PublicationDate;&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    -- Several of the above rely upon detecting this as nil, so do it last.&lt;br /&gt;
    if is_set(Periodical) then&lt;br /&gt;
        if is_set(Title) or is_set(TitleNote) then &lt;br /&gt;
            Periodical = sepc .. &amp;quot; &amp;quot; .. wrap( 'italic-title', Periodical ) &lt;br /&gt;
        else &lt;br /&gt;
            Periodical = wrap( 'italic-title', Periodical )&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Handle the oddity that is cite speech.  This code overrides whatever may be the value assigned to TitleNote (through |department=) and forces it to be &amp;quot; (Speech)&amp;quot; so that&lt;br /&gt;
the annotation directly follows the |title= parameter value in the citation rather than the |event= parameter value (if provided).&lt;br /&gt;
]]&lt;br /&gt;
	if &amp;quot;speech&amp;quot; == config.CitationClass then				-- cite speech only&lt;br /&gt;
		TitleNote = &amp;quot; (Speech)&amp;quot;;							-- annotate the citation&lt;br /&gt;
		if is_set (Periodical) then							-- if Periodical, perhaps because of an included |website= or |journal= parameter &lt;br /&gt;
			if is_set (Conference) then						-- and if |event= is set&lt;br /&gt;
				Conference = Conference .. sepc .. &amp;quot; &amp;quot;;		-- then add appropriate punctuation to the end of the Conference variable before rendering&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
    -- Piece all bits together at last.  Here, all should be non-nil.&lt;br /&gt;
    -- We build things this way because it is more efficient in LUA&lt;br /&gt;
    -- not to keep reassigning to the same string variable over and over.&lt;br /&gt;
&lt;br /&gt;
    local tcommon&lt;br /&gt;
    if inArray(config.CitationClass, {&amp;quot;journal&amp;quot;,&amp;quot;citation&amp;quot;}) and is_set(Periodical) then&lt;br /&gt;
        if is_set(Others) then Others = Others .. sepc .. &amp;quot; &amp;quot; end&lt;br /&gt;
        tcommon = safejoin( {Others, Title, TitleNote, Conference, Periodical, Format, TitleType, Scale, Series, &lt;br /&gt;
            Language, Cartography, Edition, Publisher, Agency, Volume, Issue}, sepc );&lt;br /&gt;
    else &lt;br /&gt;
        tcommon = safejoin( {Title, TitleNote, Conference, Periodical, Format, TitleType, Scale, Series, Language, &lt;br /&gt;
            Volume, Issue, Others, Cartography, Edition, Publisher, Agency}, sepc );&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if #ID_list &amp;gt; 0 then&lt;br /&gt;
        ID_list = safejoin( { sepc .. &amp;quot; &amp;quot;,  table.concat( ID_list, sepc .. &amp;quot; &amp;quot; ), ID }, sepc );&lt;br /&gt;
    else&lt;br /&gt;
        ID_list = ID;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    local idcommon = safejoin( { ID_list, URL, Archived, AccessDate, Via, SubscriptionRequired, Lay, Quote }, sepc );&lt;br /&gt;
    local text;&lt;br /&gt;
    local pgtext = Position .. Page .. Pages .. At;&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Authors) then&lt;br /&gt;
        if is_set(Coauthors) then&lt;br /&gt;
            Authors = Authors .. A['AuthorSeparator'] .. &amp;quot; &amp;quot; .. Coauthors&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(Date) then&lt;br /&gt;
            Date = &amp;quot; (&amp;quot;..Date..&amp;quot;)&amp;quot; .. OrigYear .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
        elseif string.sub(Authors,-1,-1) == sepc then&lt;br /&gt;
            Authors = Authors .. &amp;quot; &amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            Authors = Authors .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
        end&lt;br /&gt;
        if is_set(Editors) then&lt;br /&gt;
            local in_text = &amp;quot; &amp;quot;;&lt;br /&gt;
            local post_text = &amp;quot;&amp;quot;;&lt;br /&gt;
            if is_set(Chapter) then&lt;br /&gt;
                in_text = in_text .. cfg.messages['in'] .. &amp;quot; &amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
                if EditorCount &amp;lt;= 1 then&lt;br /&gt;
                    post_text = &amp;quot;, &amp;quot; .. cfg.messages['editor'];&lt;br /&gt;
                else&lt;br /&gt;
                    post_text = &amp;quot;, &amp;quot; .. cfg.messages['editors'];&lt;br /&gt;
                end&lt;br /&gt;
            end &lt;br /&gt;
            if (sepc ~= '.') then in_text = in_text:lower() end&lt;br /&gt;
            Editors = in_text .. Editors .. post_text;&lt;br /&gt;
            if (string.sub(Editors,-1,-1) == sepc)&lt;br /&gt;
                then Editors = Editors .. &amp;quot; &amp;quot;&lt;br /&gt;
                else Editors = Editors .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        text = safejoin( {Authors, Date, Chapter, Place, Editors, tcommon }, sepc );&lt;br /&gt;
        text = safejoin( {text, pgtext, idcommon}, sepc );&lt;br /&gt;
    elseif is_set(Editors) then&lt;br /&gt;
        if is_set(Date) then&lt;br /&gt;
            if EditorCount &amp;lt;= 1 then&lt;br /&gt;
                Editors = Editors .. &amp;quot;, &amp;quot; .. cfg.messages['editor'];&lt;br /&gt;
            else&lt;br /&gt;
                Editors = Editors .. &amp;quot;, &amp;quot; .. cfg.messages['editors'];&lt;br /&gt;
            end&lt;br /&gt;
            Date = &amp;quot; (&amp;quot; .. Date ..&amp;quot;)&amp;quot; .. OrigYear .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
        else&lt;br /&gt;
            if EditorCount &amp;lt;= 1 then&lt;br /&gt;
                Editors = Editors .. &amp;quot; (&amp;quot; .. cfg.messages['editor'] .. &amp;quot;)&amp;quot; .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
            else&lt;br /&gt;
                Editors = Editors .. &amp;quot; (&amp;quot; .. cfg.messages['editors'] .. &amp;quot;)&amp;quot; .. sepc .. &amp;quot; &amp;quot;&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        text = safejoin( {Editors, Date, Chapter, Place, tcommon}, sepc );&lt;br /&gt;
        text = safejoin( {text, pgtext, idcommon}, sepc );&lt;br /&gt;
    else&lt;br /&gt;
        if is_set(Date) then&lt;br /&gt;
            if ( string.sub(tcommon,-1,-1) ~= sepc )&lt;br /&gt;
              then Date = sepc ..&amp;quot; &amp;quot; .. Date .. OrigYear&lt;br /&gt;
              else Date = &amp;quot; &amp;quot; .. Date .. OrigYear&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
        if config.CitationClass==&amp;quot;journal&amp;quot; and is_set(Periodical) then&lt;br /&gt;
            text = safejoin( {Chapter, Place, tcommon}, sepc );&lt;br /&gt;
            text = safejoin( {text, pgtext, Date, idcommon}, sepc );&lt;br /&gt;
        else&lt;br /&gt;
            text = safejoin( {Chapter, Place, tcommon, Date}, sepc );&lt;br /&gt;
            text = safejoin( {text, pgtext, idcommon}, sepc );&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
	if is_set(PostScript) and PostScript ~= sepc then&lt;br /&gt;
		text = safejoin( {text, sepc}, sepc );  --Deals with italics, spaces, etc.&lt;br /&gt;
		text = text:sub(1,-sepc:len()-1);&lt;br /&gt;
--		text = text:sub(1,-2);	--Remove final separator (assumes that sepc is only one character)&lt;br /&gt;
	end    &lt;br /&gt;
    &lt;br /&gt;
    text = safejoin( {text, PostScript}, sepc );&lt;br /&gt;
&lt;br /&gt;
    -- Now enclose the whole thing in a &amp;lt;span/&amp;gt; element&lt;br /&gt;
    local options = {};&lt;br /&gt;
    &lt;br /&gt;
    if is_set(config.CitationClass) and config.CitationClass ~= &amp;quot;citation&amp;quot; then&lt;br /&gt;
        options.class = &amp;quot;citation &amp;quot; .. config.CitationClass;&lt;br /&gt;
    else&lt;br /&gt;
        options.class = &amp;quot;citation&amp;quot;;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(Ref) and Ref:lower() ~= &amp;quot;none&amp;quot; then&lt;br /&gt;
        local id = Ref&lt;br /&gt;
        if ( &amp;quot;harv&amp;quot; == Ref ) then&lt;br /&gt;
            local names = {} --table of last names &amp;amp; year&lt;br /&gt;
            if #a &amp;gt; 0 then&lt;br /&gt;
                for i,v in ipairs(a) do &lt;br /&gt;
                    names[i] = v.last &lt;br /&gt;
                    if i == 4 then break end&lt;br /&gt;
                end&lt;br /&gt;
            elseif #e &amp;gt; 0 then&lt;br /&gt;
                for i,v in ipairs(e) do &lt;br /&gt;
                    names[i] = v.last &lt;br /&gt;
                    if i == 4 then break end                &lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
			names[ #names + 1 ] = first_set(Year, anchor_year);	-- Year first for legacy citations&lt;br /&gt;
            id = anchorid(names)&lt;br /&gt;
        end&lt;br /&gt;
        options.id = id;&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if string.len(text:gsub(&amp;quot;&amp;lt;span[^&amp;gt;/]*&amp;gt;.-&amp;lt;/span&amp;gt;&amp;quot;, &amp;quot;&amp;quot;):gsub(&amp;quot;%b&amp;lt;&amp;gt;&amp;quot;,&amp;quot;&amp;quot;)) &amp;lt;= 2 then&lt;br /&gt;
        z.error_categories = {};&lt;br /&gt;
        text = seterror('empty_citation');&lt;br /&gt;
        z.message_tail = {};&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    if is_set(options.id) then &lt;br /&gt;
        text = '&amp;lt;span id=&amp;quot;' .. mw.uri.anchorEncode(options.id) ..'&amp;quot; class=&amp;quot;' .. mw.text.nowiki(options.class) .. '&amp;quot;&amp;gt;' .. text .. &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;;&lt;br /&gt;
    else&lt;br /&gt;
        text = '&amp;lt;span class=&amp;quot;' .. mw.text.nowiki(options.class) .. '&amp;quot;&amp;gt;' .. text .. &amp;quot;&amp;lt;/span&amp;gt;&amp;quot;;&lt;br /&gt;
    end        &lt;br /&gt;
&lt;br /&gt;
    local empty_span = '&amp;lt;span style=&amp;quot;display:none;&amp;quot;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;';&lt;br /&gt;
    &lt;br /&gt;
    -- Note: Using display: none on then COinS span breaks some clients.&lt;br /&gt;
    local OCinS = '&amp;lt;span title=&amp;quot;' .. OCinSoutput .. '&amp;quot; class=&amp;quot;Z3988&amp;quot;&amp;gt;' .. empty_span .. '&amp;lt;/span&amp;gt;';&lt;br /&gt;
    text = text .. OCinS;&lt;br /&gt;
    &lt;br /&gt;
    if #z.message_tail ~= 0 then&lt;br /&gt;
        text = text .. &amp;quot; &amp;quot;;&lt;br /&gt;
        for i,v in ipairs( z.message_tail ) do&lt;br /&gt;
            if is_set(v[1]) then&lt;br /&gt;
                if i == #z.message_tail then&lt;br /&gt;
                    text = text .. errorcomment( v[1], v[2] );&lt;br /&gt;
                else&lt;br /&gt;
                    text = text .. errorcomment( v[1] .. &amp;quot;; &amp;quot;, v[2] );&lt;br /&gt;
                end&lt;br /&gt;
            end&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    no_tracking_cats = no_tracking_cats:lower();&lt;br /&gt;
    if inArray(no_tracking_cats, {&amp;quot;&amp;quot;, &amp;quot;no&amp;quot;, &amp;quot;false&amp;quot;, &amp;quot;n&amp;quot;}) then&lt;br /&gt;
        for _, v in ipairs( z.error_categories ) do&lt;br /&gt;
            text = text .. '[[Category:' .. v ..']]';&lt;br /&gt;
        end&lt;br /&gt;
    end&lt;br /&gt;
    &lt;br /&gt;
    return text&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- This is used by templates such as {{cite book}} to create the actual citation text.&lt;br /&gt;
function z.citation(frame)&lt;br /&gt;
    local pframe = frame:getParent()&lt;br /&gt;
    &lt;br /&gt;
    if nil ~= string.find( frame:getTitle(), 'sandbox', 1, true ) then				-- did the {{#invoke:}} use sandbox version?&lt;br /&gt;
    	cfg = mw.loadData( 'Module:Citation/CS1/Configuration/sandbox' );	-- load sandbox versions of Configuration and Whitelist and ...&lt;br /&gt;
    	whitelist = mw.loadData( 'Module:Citation/CS1/Whitelist/sandbox' );&lt;br /&gt;
    	dates = require('Module:Citation/CS1/Date_validation/sandbox').dates	-- ... sandbox version of date validation code&lt;br /&gt;
    else																	-- otherwise&lt;br /&gt;
    	cfg = mw.loadData( 'Module:Citation/CS1/Configuration' );			-- load live versions of Configuration and Whitelist and ...&lt;br /&gt;
    	whitelist = mw.loadData( 'Module:Citation/CS1/Whitelist' );&lt;br /&gt;
    	dates = require('Module:Citation/CS1/Date_validation').dates		-- ... live version of date validation code&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
    local args = {};&lt;br /&gt;
    local suggestions = {};&lt;br /&gt;
    local error_text, error_state;&lt;br /&gt;
&lt;br /&gt;
    local config = {};&lt;br /&gt;
    for k, v in pairs( frame.args ) do&lt;br /&gt;
        config[k] = v;&lt;br /&gt;
        args[k] = v;       &lt;br /&gt;
    end    &lt;br /&gt;
&lt;br /&gt;
    for k, v in pairs( pframe.args ) do&lt;br /&gt;
        if v ~= '' then&lt;br /&gt;
            if not validate( k ) then            &lt;br /&gt;
                error_text = &amp;quot;&amp;quot;;&lt;br /&gt;
                if type( k ) ~= 'string' then&lt;br /&gt;
                    -- Exclude empty numbered parameters&lt;br /&gt;
                    if v:match(&amp;quot;%S+&amp;quot;) ~= nil then&lt;br /&gt;
                        error_text, error_state = seterror( 'text_ignored', {v}, true );&lt;br /&gt;
                    end&lt;br /&gt;
                elseif validate( k:lower() ) then &lt;br /&gt;
                    error_text, error_state = seterror( 'parameter_ignored_suggest', {k, k:lower()}, true );&lt;br /&gt;
                else&lt;br /&gt;
                    if #suggestions == 0 then&lt;br /&gt;
                        suggestions = mw.loadData( 'Module:Citation/CS1/Suggestions' );&lt;br /&gt;
                    end&lt;br /&gt;
                    if suggestions[ k:lower() ] ~= nil then&lt;br /&gt;
                        error_text, error_state = seterror( 'parameter_ignored_suggest', {k, suggestions[ k:lower() ]}, true );&lt;br /&gt;
                    else&lt;br /&gt;
                        error_text, error_state = seterror( 'parameter_ignored', {k}, true );&lt;br /&gt;
                    end&lt;br /&gt;
                end                  &lt;br /&gt;
                if error_text ~= '' then&lt;br /&gt;
                    table.insert( z.message_tail, {error_text, error_state} );&lt;br /&gt;
                end                &lt;br /&gt;
            end&lt;br /&gt;
            args[k] = v;&lt;br /&gt;
        elseif args[k] ~= nil or (k == 'postscript') then&lt;br /&gt;
            args[k] = v;&lt;br /&gt;
        end        &lt;br /&gt;
    end    &lt;br /&gt;
    &lt;br /&gt;
    return citation0( config, args)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return z&lt;/div&gt;</summary>
		<author><name>Trappist the monk</name></author>	</entry>

	<entry>
		<id>http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Configuration</id>
		<title>Module:Citation/CS1/Configuration</title>
		<link rel="alternate" type="text/html" href="http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Configuration"/>
				<updated>2014-03-30T12:24:37Z</updated>
		
		<summary type="html">&lt;p&gt;Trappist the monk: Synch from sandbox;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;citation_config = {};&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
List of namespaces that should not be included in citation&lt;br /&gt;
error categories.  Same as setting notracking = true by default&lt;br /&gt;
&lt;br /&gt;
Note: Namespace names should use underscores instead of spaces.&lt;br /&gt;
]]&lt;br /&gt;
citation_config.uncategorized_namespaces = { 'User', 'Talk', 'User_talk', 'Wikipedia_talk', 'File_talk', 'Template_talk',&lt;br /&gt;
	'Help_talk', 'Category_talk', 'Portal_talk', 'Book_talk', 'Draft', 'Draft_talk', 'Education_Program_talk', &lt;br /&gt;
	'Module_talk', 'MediaWiki_talk' };&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Translation table&lt;br /&gt;
&lt;br /&gt;
The following contains fixed text that may be output as part of a citation.&lt;br /&gt;
This is separated from the main body to aid in future translations of this&lt;br /&gt;
module.&lt;br /&gt;
]]&lt;br /&gt;
citation_config.messages = {&lt;br /&gt;
  ['published'] = 'published $1',&lt;br /&gt;
  ['lay summary'] = 'Lay summary',&lt;br /&gt;
  ['retrieved'] = 'Retrieved $1',&lt;br /&gt;
  ['inactive'] = 'inactive',&lt;br /&gt;
  ['archived-dead'] = 'Archived from $1 on $2',&lt;br /&gt;
  ['archived-not-dead'] = '$1 from the original on $2',&lt;br /&gt;
  ['archived-missing'] = 'Archived from the original$1 on $2',&lt;br /&gt;
  ['archived'] = 'Archived',&lt;br /&gt;
  ['original'] = 'the original',&lt;br /&gt;
  ['editor'] = 'ed.',&lt;br /&gt;
  ['editors'] = 'eds.', &lt;br /&gt;
  ['edition'] = '($1 ed.)', &lt;br /&gt;
  ['episode'] = 'episode',&lt;br /&gt;
  ['season'] = 'season', &lt;br /&gt;
  ['series'] = 'series',&lt;br /&gt;
  ['cartography'] = 'Cartography by $1',&lt;br /&gt;
  ['section'] = 'Section $1',&lt;br /&gt;
  ['inset'] = '$1 inset',&lt;br /&gt;
  ['written'] = 'Written at $1',&lt;br /&gt;
  ['in'] = 'In',&lt;br /&gt;
  ['et al'] = 'et al.', &lt;br /&gt;
  &lt;br /&gt;
  ['subscription'] = '&amp;lt;span style=&amp;quot;font-size:0.95em; font-size:90%; color:#555&amp;quot;&amp;gt;(subscription required (&amp;lt;span title=&amp;quot;Sources are not required to be available online. Online sources do not have to be freely available. The site may require a paid subscription.&amp;quot; style=&amp;quot;border-bottom:1px dotted;cursor:help&amp;quot;&amp;gt;help&amp;lt;/span&amp;gt;))&amp;lt;/span&amp;gt;' ..&lt;br /&gt;
  	'[[Category:Pages containing links to subscription-only content]]', &lt;br /&gt;
&lt;br /&gt;
  ['registration']='&amp;lt;span style=&amp;quot;font-size:0.95em; font-size:90%; color:#555&amp;quot;&amp;gt;(registration required (&amp;lt;span title=&amp;quot;Sources are not required to be available online. Online sources do not have to be freely available. The site may require registration.&amp;quot; style=&amp;quot;border-bottom:1px dotted;cursor:help&amp;quot;&amp;gt;help&amp;lt;/span&amp;gt;))&amp;lt;/span&amp;gt;' ..&lt;br /&gt;
  	'[[Category:Pages with login required references or sources]]',&lt;br /&gt;
  &lt;br /&gt;
  ['language'] = '(in $1)', &lt;br /&gt;
  ['via'] = &amp;quot; &amp;amp;ndash; via $1&amp;quot;,&lt;br /&gt;
  ['event'] = 'Event occurs at',&lt;br /&gt;
  ['minutes'] = 'minutes in', &lt;br /&gt;
&lt;br /&gt;
  ['quoted-title'] = '&amp;quot;$1&amp;quot;',&lt;br /&gt;
  ['italic-title'] = &amp;quot;''$1''&amp;quot;,&lt;br /&gt;
  ['trans-quoted-title'] = &amp;quot;&amp;amp;#91;$1&amp;amp;#93;&amp;quot;,&lt;br /&gt;
  ['trans-italic-title'] = &amp;quot;&amp;amp;#91;''$1''&amp;amp;#93;&amp;quot;,&lt;br /&gt;
  ['quoted-text'] = '&amp;quot;$1&amp;quot;',&lt;br /&gt;
&lt;br /&gt;
  ['parameter'] = '&amp;lt;code&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt;',&lt;br /&gt;
  ['parameter-separator'] = ', ',&lt;br /&gt;
  ['parameter-final-separator'] = ', and ',&lt;br /&gt;
  ['parameter-pair-separator'] = ' and ',&lt;br /&gt;
&lt;br /&gt;
  -- Error output&lt;br /&gt;
  ['hidden-error'] = '&amp;lt;span style=&amp;quot;display:none;font-size:100%&amp;quot; class=&amp;quot;error citation-comment&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;',&lt;br /&gt;
  ['visible-error'] = '&amp;lt;span style=&amp;quot;font-size:100%&amp;quot; class=&amp;quot;error citation-comment&amp;quot;&amp;gt;$1&amp;lt;/span&amp;gt;',&lt;br /&gt;
  &lt;br /&gt;
  -- Determines the location of the help page&lt;br /&gt;
  ['help page link'] = 'Help:CS1 errors',&lt;br /&gt;
  ['help page label'] = 'help',&lt;br /&gt;
  &lt;br /&gt;
  -- Internal errors (should only occur if configuration is bad)&lt;br /&gt;
  ['undefined_error'] = 'Called with an undefined error condition',&lt;br /&gt;
  ['unknown_manual_ID'] = 'Unrecognized manual ID mode',&lt;br /&gt;
  ['unknown_ID_mode'] = 'Unrecognized ID mode',&lt;br /&gt;
  ['unknown_argument_map'] = 'Argument map not defined for this variable',&lt;br /&gt;
  ['bare_url_no_origin'] = 'Bare url found but origin indicator is nil or empty',&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Aliases table for commonly passed parameters&lt;br /&gt;
citation_config.aliases = {&lt;br /&gt;
    ['AccessDate'] = 'accessdate',&lt;br /&gt;
    ['Agency'] = 'agency',&lt;br /&gt;
    ['AirDate'] = 'airdate',&lt;br /&gt;
    ['ArchiveDate'] = {'archive-date', 'archivedate' },&lt;br /&gt;
    ['ArchiveURL'] = {'archive-url', 'archiveurl' },&lt;br /&gt;
    ['ASINTLD'] = {'ASIN-TLD', 'asin-tld'},&lt;br /&gt;
    ['At'] = 'at',&lt;br /&gt;
    ['Authors'] = {'authors', 'people', 'host'},&lt;br /&gt;
    ['AuthorFormat'] = {&amp;quot;author-format&amp;quot;, &amp;quot;authorformat&amp;quot; },&lt;br /&gt;
    ['AuthorSeparator'] = 'author-separator',&lt;br /&gt;
    ['AuthorNameSeparator'] = 'author-name-separator',&lt;br /&gt;
    ['BookTitle'] = 'booktitle',&lt;br /&gt;
	['Callsign'] = 'callsign',							-- cite interview&lt;br /&gt;
    ['Cartography'] = 'cartography',&lt;br /&gt;
    ['Chapter'] = {'chapter', 'contribution', 'entry', 'article', 'section', 'notestitle'},		-- notestitle is deprecated used by old cite AV media notes; remove after 1 October 2014;&lt;br /&gt;
    ['ChapterLink'] = 'chapterlink',&lt;br /&gt;
    ['ChapterURL'] = {'chapter-url', 'chapterurl', 'contribution-url', 'contributionurl', 'sectionurl' },&lt;br /&gt;
	['City'] = 'city',									-- cite interview&lt;br /&gt;
    ['Coauthors'] = {'coauthors', 'coauthor' },&lt;br /&gt;
    ['Cointerviewers'] = 'cointerviewers',				-- cite interview&lt;br /&gt;
    ['Conference'] = {'conference', 'event' },&lt;br /&gt;
    ['ConferenceURL'] = {'conference-url', 'conferenceurl', 'eventurl' },&lt;br /&gt;
    ['Date'] = 'date',&lt;br /&gt;
    ['Day'] = 'day',&lt;br /&gt;
    ['DeadURL'] = 'deadurl',&lt;br /&gt;
    ['Degree'] = 'degree',&lt;br /&gt;
    ['DisplayAuthors'] = {&amp;quot;display-authors&amp;quot;, &amp;quot;displayauthors&amp;quot;},&lt;br /&gt;
    ['DisplayEditors'] = {&amp;quot;display-editors&amp;quot;, &amp;quot;displayeditors&amp;quot;},&lt;br /&gt;
    ['Docket'] = 'docket',&lt;br /&gt;
    ['DoiBroken'] = {'doi_inactivedate', 'doi_brokendate', 'DoiBroken'},&lt;br /&gt;
    ['Edition'] = 'edition',&lt;br /&gt;
    ['Editors'] = 'editors',&lt;br /&gt;
    ['EditorFormat'] = {&amp;quot;editor-format&amp;quot;, &amp;quot;editorformat&amp;quot; },&lt;br /&gt;
    ['EditorSeparator'] = 'editor-separator',&lt;br /&gt;
    ['EditorNameSeparator'] = 'editor-name-separator',&lt;br /&gt;
    ['Embargo'] = {'Embargo', 'embargo'},&lt;br /&gt;
    ['Format'] = 'format',&lt;br /&gt;
    ['ID'] = {'id', 'ID', 'publisherid'},				-- publisherid is deprecated; used by old cite AV media notes and old cite DVD notes; remove after 1 October 2014;&lt;br /&gt;
    ['IgnoreISBN'] = {'ignore-isbn-error', 'ignoreisbnerror'},&lt;br /&gt;
    ['Inset'] = 'inset',&lt;br /&gt;
    ['Interviewer'] = 'interviewer',					-- cite interview&lt;br /&gt;
    ['Issue'] = {'issue', 'number'},&lt;br /&gt;
    ['Language'] = {'language', 'in'},&lt;br /&gt;
    ['LastAuthorAmp'] = 'lastauthoramp',&lt;br /&gt;
    ['LayDate'] = 'laydate',&lt;br /&gt;
    ['LaySource'] = 'laysource',&lt;br /&gt;
    ['LayURL'] = {'layurl', 'laysummary'},&lt;br /&gt;
    ['Minutes'] = 'minutes',&lt;br /&gt;
    ['Month'] = 'month',&lt;br /&gt;
    ['NameSeparator'] = 'name-separator',&lt;br /&gt;
    ['Network'] = 'network',&lt;br /&gt;
    ['NoPP'] = 'nopp',&lt;br /&gt;
    ['NoTracking'] = {&amp;quot;template doc demo&amp;quot;, 'nocat', &lt;br /&gt;
        'notracking', &amp;quot;no-tracking&amp;quot;},&lt;br /&gt;
    ['OrigYear'] = {'origyear', 'titleyear'},			-- titleyear is deprecated; used in old cite DVD notes; remove after 1 October 2014&lt;br /&gt;
    ['Others'] = {'others', 'artist', 'director'},		-- artist and director are deprecated; used in old cite AV media notes and old cite DVD notes; remove after 1 October 2014&lt;br /&gt;
    ['Page'] = {'p', 'page'},&lt;br /&gt;
    ['Pages'] = {'pp', 'pages'},&lt;br /&gt;
    ['Periodical'] = {'journal', 'newspaper', 'magazine', 'work',&lt;br /&gt;
        'website',  'periodical', 'encyclopedia', 'encyclopaedia', 'dictionary'},&lt;br /&gt;
    ['Place'] = {'place', 'location'},&lt;br /&gt;
    ['PPrefix'] = 'PPrefix',&lt;br /&gt;
    ['PPPrefix'] = 'PPPrefix',&lt;br /&gt;
	['Program'] = 'program',							-- cite interview&lt;br /&gt;
    ['PostScript'] = 'postscript',&lt;br /&gt;
    ['PublicationDate'] = {'publicationdate', 'publication-date' },&lt;br /&gt;
    ['PublicationPlace'] = {'publication-place', 'publicationplace' },&lt;br /&gt;
    ['PublisherName'] = {'publisher', 'distributor', 'institution'},&lt;br /&gt;
    ['Quote'] = {'quote', 'quotation'},&lt;br /&gt;
    ['Ref'] = {'ref', 'Ref'},&lt;br /&gt;
    ['RegistrationRequired'] = 'registration',&lt;br /&gt;
    ['Scale'] = 'scale',&lt;br /&gt;
    ['Section'] = 'section',&lt;br /&gt;
    ['Season'] = 'season',&lt;br /&gt;
    ['Separator'] = 'separator',&lt;br /&gt;
    ['Series'] = {'series', 'version'},&lt;br /&gt;
    ['SeriesSeparator'] = 'series-separator',&lt;br /&gt;
    ['SeriesLink'] = 'serieslink',&lt;br /&gt;
    ['SeriesNumber'] = {'seriesnumber', 'seriesno'},&lt;br /&gt;
    ['Station'] = 'station',&lt;br /&gt;
    ['SubscriptionRequired'] = 'subscription',&lt;br /&gt;
    ['Time'] = 'time',&lt;br /&gt;
    ['TimeCaption'] = 'timecaption',&lt;br /&gt;
    ['Title'] = 'title',&lt;br /&gt;
    ['TitleLink'] = {'titlelink', 'episodelink', 'albumlink' },		-- albumlink is deprecated; used by old cite AV media notes; remove after 1 October 2014&lt;br /&gt;
    ['TitleNote'] = 'department',&lt;br /&gt;
    ['TitleType'] = {'type', 'medium'},&lt;br /&gt;
    ['TransChapter'] = {'trans-chapter', 'trans_chapter' },&lt;br /&gt;
    ['Transcript'] = 'transcript',&lt;br /&gt;
    ['TranscriptURL'] = {'transcript-url', 'transcripturl'},&lt;br /&gt;
    ['TransTitle'] = {'trans-title', 'trans_title' },&lt;br /&gt;
    ['URL'] = {'url', 'URL'},&lt;br /&gt;
    ['Via'] = 'via',&lt;br /&gt;
    ['Volume'] = 'volume',&lt;br /&gt;
    ['Year'] = 'year',&lt;br /&gt;
&lt;br /&gt;
    ['AuthorList-First'] = {&amp;quot;author#-first&amp;quot;, &amp;quot;author-first#&amp;quot;,&lt;br /&gt;
        &amp;quot;first#&amp;quot;, &amp;quot;given#&amp;quot;},&lt;br /&gt;
    ['AuthorList-Last'] = {&amp;quot;author#-last&amp;quot;, &amp;quot;author-last#&amp;quot;, &lt;br /&gt;
        &amp;quot;last#&amp;quot;, &amp;quot;surname#&amp;quot;, &amp;quot;Author#&amp;quot;, &amp;quot;author#&amp;quot;, &amp;quot;authors#&amp;quot;, &amp;quot;subject#&amp;quot;},&lt;br /&gt;
    ['AuthorList-Link'] = {&amp;quot;author#-link&amp;quot;, &amp;quot;author-link#&amp;quot;, &lt;br /&gt;
        &amp;quot;author#link&amp;quot;, &amp;quot;authorlink#&amp;quot;, &amp;quot;subjectlink#&amp;quot;},&lt;br /&gt;
    ['AuthorList-Mask'] = {&amp;quot;author#-mask&amp;quot;, &amp;quot;author-mask#&amp;quot;, &lt;br /&gt;
        &amp;quot;author#mask&amp;quot;, &amp;quot;authormask#&amp;quot;},&lt;br /&gt;
    &lt;br /&gt;
    ['EditorList-First'] = {&amp;quot;editor#-first&amp;quot;, &lt;br /&gt;
        &amp;quot;editor-first#&amp;quot;, &amp;quot;EditorGiven#&amp;quot;},&lt;br /&gt;
    ['EditorList-Last'] = {&amp;quot;editor#-last&amp;quot;, &amp;quot;editor-last#&amp;quot;,&lt;br /&gt;
        &amp;quot;EditorSurname#&amp;quot;, &amp;quot;Editor#&amp;quot;, &amp;quot;editor#&amp;quot;, &amp;quot;editors#&amp;quot;},&lt;br /&gt;
    ['EditorList-Link'] = {&amp;quot;editor#-link&amp;quot;, &amp;quot;editor-link#&amp;quot;, &lt;br /&gt;
        &amp;quot;editor#link&amp;quot;, &amp;quot;editorlink#&amp;quot;},&lt;br /&gt;
    ['EditorList-Mask'] = {&amp;quot;editor#-mask&amp;quot;, &amp;quot;editor-mask#&amp;quot;, &lt;br /&gt;
        &amp;quot;editor#mask&amp;quot;, &amp;quot;editormask#&amp;quot;},&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-- Default parameter values&lt;br /&gt;
citation_config.defaults = {&lt;br /&gt;
    ['DeadURL'] = 'yes',&lt;br /&gt;
    ['AuthorSeparator'] = ';',&lt;br /&gt;
    ['EditorSeparator'] = ';',&lt;br /&gt;
    ['NameSeparator'] = ',',&lt;br /&gt;
    ['PPrefix'] = &amp;quot;p.&amp;amp;nbsp;&amp;quot;,&lt;br /&gt;
    ['PPPrefix'] = &amp;quot;pp.&amp;amp;nbsp;&amp;quot;,    &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Error condition table&lt;br /&gt;
&lt;br /&gt;
The following contains a list of IDs for various error conditions defined in the &lt;br /&gt;
code.  For each ID, we specify a text message to display, an error category to&lt;br /&gt;
include, and whether the error message should be wrapped as a hidden comment.&lt;br /&gt;
&lt;br /&gt;
Anchor changes require identical changes to matching anchor in Help:CS1 errors&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
citation_config.error_conditions = {&lt;br /&gt;
	accessdate_missing_url = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;accessdate=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'accessdate_missing_url',&lt;br /&gt;
		category = 'Pages using citations with accessdate and no URL',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	archive_missing_date = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;archiveurl=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;archivedate=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'archive_missing_date',&lt;br /&gt;
		category = 'Pages with archiveurl citation errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	archive_missing_url = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;archiveurl=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'archive_missing_url',&lt;br /&gt;
		category = 'Pages with archiveurl citation errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_authorlink = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;authorlink=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_authorlink',&lt;br /&gt;
		category = 'CS1 errors: authorlink',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_date = {&lt;br /&gt;
		message = 'Check date values in: &amp;lt;code&amp;gt;$1&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'bad_date',&lt;br /&gt;
		category = 'CS1 errors: dates',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	bad_doi = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;doi=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_doi',&lt;br /&gt;
		category = 'Pages with DOI errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_isbn = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;isbn=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_isbn',&lt;br /&gt;
		category = 'Pages with ISBN errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_issn = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;issn=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_issn',&lt;br /&gt;
		category = 'CS1 errors: ISSN',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_lccn = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;lccn=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_lccn',&lt;br /&gt;
		category = 'CS1 errors: LCCN',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_ol = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;ol=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_ol',&lt;br /&gt;
		category = 'Pages with OL errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_pmc = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;pmc=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_pmc',&lt;br /&gt;
		category = 'CS1 errors: PMC',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_pmid = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;pmid=&amp;lt;/code&amp;gt; value',&lt;br /&gt;
		anchor = 'bad_pmid',&lt;br /&gt;
		category = 'CS1 errors: PMID',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bad_url = {&lt;br /&gt;
		message = 'Check &amp;lt;code&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt; scheme',&lt;br /&gt;
		anchor = 'bad_url',&lt;br /&gt;
		category = 'Pages with URL errors',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	bare_url_missing_title = {&lt;br /&gt;
		message = '$1 missing title',&lt;br /&gt;
		anchor = 'bare_url_missing_title',&lt;br /&gt;
		category = 'Pages with citations having bare URLs',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	citation_missing_title = {&lt;br /&gt;
		message = 'Missing or empty &amp;lt;code&amp;gt;&amp;amp;#124;title=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'citation_missing_title',&lt;br /&gt;
		category = 'Pages with citations lacking titles',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	cite_web_url = {											-- this error applies to cite web and to cite podcast&lt;br /&gt;
		message = 'Missing or empty &amp;lt;code&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'cite_web_url',&lt;br /&gt;
		category = 'Pages using web citations with no URL',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	coauthors_missing_author = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;coauthors=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;author=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'coauthors_missing_author',&lt;br /&gt;
		category = 'CS1 errors: coauthors without author',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	deprecated_params = {&lt;br /&gt;
		message = 'Cite uses deprecated parameters',&lt;br /&gt;
		anchor = 'deprecated_params',&lt;br /&gt;
		category = 'Pages containing cite templates with deprecated parameters',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	empty_citation = {&lt;br /&gt;
		message = 'Empty citation',&lt;br /&gt;
		anchor = 'empty_citation',&lt;br /&gt;
		category = 'Pages with empty citations',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	extra_pages = {&lt;br /&gt;
		message = 'Extra &amp;lt;code&amp;gt;&amp;amp;#124;pages=&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;&amp;amp;#124;at=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'extra_pages',&lt;br /&gt;
		category = 'Pages with citations using conflicting page specifications',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	format_missing_url = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;format=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;url=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'format_missing_url',&lt;br /&gt;
		category = 'Pages using citations with format and no URL',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	implict_etal_author = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;displayauthors=&amp;lt;/code&amp;gt; suggested',&lt;br /&gt;
		anchor = 'displayauthors',&lt;br /&gt;
		category = 'Pages using citations with old-style implicit et al.',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	implict_etal_editor = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;displayeditors=&amp;lt;/code&amp;gt; suggested',&lt;br /&gt;
		anchor = 'displayeditors',&lt;br /&gt;
		category = 'Pages using citations with old-style implicit et al. in editors',&lt;br /&gt;
		hidden = true },&lt;br /&gt;
	parameter_ignored = {&lt;br /&gt;
		message = 'Unknown parameter &amp;lt;code&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored',&lt;br /&gt;
		anchor = 'parameter_ignored',&lt;br /&gt;
		category = 'Pages with citations using unsupported parameters',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	parameter_ignored_suggest = {&lt;br /&gt;
		message = 'Unknown parameter &amp;lt;code&amp;gt;&amp;amp;#124;$1=&amp;lt;/code&amp;gt; ignored (&amp;lt;code&amp;gt;&amp;amp;#124;$2=&amp;lt;/code&amp;gt; suggested)',&lt;br /&gt;
		anchor = 'parameter_ignored_suggest',&lt;br /&gt;
		category = 'Pages with citations using unsupported parameters',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	redundant_parameters = {&lt;br /&gt;
		message = 'More than one of $1 specified',&lt;br /&gt;
		anchor = 'redundant_parameters',&lt;br /&gt;
		category = 'Pages with citations having redundant parameters',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	text_ignored = {&lt;br /&gt;
		message = 'Text &amp;quot;$1&amp;quot; ignored',&lt;br /&gt;
		anchor = 'text_ignored',&lt;br /&gt;
		category = 'Pages with citations using unnamed parameters',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	trans_missing_chapter = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;trans_chapter=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;chapter=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'trans_missing_chapter',&lt;br /&gt;
		category = 'Pages with citations using translated terms without the original',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	trans_missing_title = {&lt;br /&gt;
		message = '&amp;lt;code&amp;gt;&amp;amp;#124;trans_title=&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;&amp;amp;#124;title=&amp;lt;/code&amp;gt;',&lt;br /&gt;
		anchor = 'trans_missing_title',&lt;br /&gt;
		category = 'Pages with citations using translated terms without the original',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
	wikilink_in_url = {&lt;br /&gt;
		message = 'Wikilink embedded in URL title',&lt;br /&gt;
		anchor = 'wikilink_in_url',&lt;br /&gt;
		category = 'Pages with citations having wikilinks embedded in URL titles',&lt;br /&gt;
		hidden = false },&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
citation_config.id_handlers = {&lt;br /&gt;
    ['ARXIV'] = {&lt;br /&gt;
        parameters = {'arxiv', 'ARXIV'}, &lt;br /&gt;
        link = 'arXiv',&lt;br /&gt;
        label = 'arXiv',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//arxiv.org/abs/', -- protocol relative tested 2013-09-04&lt;br /&gt;
        encode = false,&lt;br /&gt;
        COinS = 'info:arxiv',&lt;br /&gt;
        separator = ':',&lt;br /&gt;
    },&lt;br /&gt;
    ['ASIN'] = {&lt;br /&gt;
        parameters = { 'asin', 'ASIN' },       &lt;br /&gt;
        link = 'Amazon Standard Identification Number',&lt;br /&gt;
        label = 'ASIN',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        COinS = 'info:asin',&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
        encode = false;&lt;br /&gt;
    },&lt;br /&gt;
    ['BIBCODE'] = {&lt;br /&gt;
        parameters = {'bibcode', 'BIBCODE'}, &lt;br /&gt;
        link = 'Bibcode',&lt;br /&gt;
        label = 'Bibcode',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = 'http://adsabs.harvard.edu/abs/',&lt;br /&gt;
        encode = false,&lt;br /&gt;
        COinS = 'info:bibcode',&lt;br /&gt;
        separator = ':',&lt;br /&gt;
    },&lt;br /&gt;
    ['DOI'] = {&lt;br /&gt;
        parameters = { 'doi', 'DOI' },&lt;br /&gt;
        link = 'Digital object identifier',&lt;br /&gt;
        label = 'doi',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        prefix = 'http://dx.doi.org/',&lt;br /&gt;
        COinS = 'info:doi',&lt;br /&gt;
        separator = ':',&lt;br /&gt;
        encode = true,&lt;br /&gt;
    },&lt;br /&gt;
    ['ISBN'] = {&lt;br /&gt;
        parameters = {'isbn', 'ISBN', 'isbn13', 'ISBN13'}, &lt;br /&gt;
        link = 'International Standard Book Number',&lt;br /&gt;
        label = 'ISBN',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        prefix = 'Special:BookSources/',&lt;br /&gt;
        COinS = 'rft.isbn',&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['ISSN'] = {&lt;br /&gt;
        parameters = {'issn', 'ISSN'}, &lt;br /&gt;
        link = 'International Standard Serial Number',&lt;br /&gt;
        label = 'ISSN',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        prefix = '//www.worldcat.org/issn/',&lt;br /&gt;
        COinS = 'rft.issn',&lt;br /&gt;
        encode = false,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['JFM'] = {&lt;br /&gt;
        parameters = {'jfm', 'JFM'}, &lt;br /&gt;
        link = 'Jahrbuch über die Fortschritte der Mathematik',&lt;br /&gt;
        label = 'JFM',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = 'http://www.zentralblatt-math.org/zmath/en/search/?format=complete&amp;amp;q=an:',&lt;br /&gt;
        COinS = 'rft.jfm',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['JSTOR'] = {&lt;br /&gt;
        parameters = {'jstor', 'JSTOR'}, &lt;br /&gt;
        link = 'JSTOR',&lt;br /&gt;
        label = 'JSTOR',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//www.jstor.org/stable/', -- protocol relative tested 2013-09-04&lt;br /&gt;
        COinS = 'rft.jstor',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['LCCN'] = {&lt;br /&gt;
        parameters = {'LCCN', 'lccn'}, &lt;br /&gt;
        link = 'Library of Congress Control Number',&lt;br /&gt;
        label = 'LCCN',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        prefix = 'http://lccn.loc.gov/',&lt;br /&gt;
        COinS = 'rft.lccn',&lt;br /&gt;
        encode = false,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['MR'] = {&lt;br /&gt;
        parameters = {'MR', 'mr'}, &lt;br /&gt;
        link = 'Mathematical Reviews',&lt;br /&gt;
        label = 'MR',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//www.ams.org/mathscinet-getitem?mr=', -- protocol relative tested 2013-09-04&lt;br /&gt;
        COinS = 'rft.mr',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['OCLC'] = {&lt;br /&gt;
        parameters = {'OCLC', 'oclc'}, &lt;br /&gt;
        link = 'OCLC',&lt;br /&gt;
        label = 'OCLC',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//www.worldcat.org/oclc/',&lt;br /&gt;
        COinS = 'info:oclcnum',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['OL'] = {&lt;br /&gt;
        parameters = { 'ol', 'OL' },&lt;br /&gt;
        link = 'Open Library',&lt;br /&gt;
        label = 'OL',&lt;br /&gt;
        mode = 'manual',&lt;br /&gt;
        COinS = 'info:olnum',&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
        endode = true,&lt;br /&gt;
    },&lt;br /&gt;
    ['OSTI'] = {&lt;br /&gt;
        parameters = {'OSTI', 'osti'}, &lt;br /&gt;
        link = 'Office of Scientific and Technical Information',&lt;br /&gt;
        label = 'OSTI',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//www.osti.gov/energycitations/product.biblio.jsp?osti_id=', -- protocol relative tested 2013-09-04&lt;br /&gt;
        COinS = 'info:osti',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['PMC'] = {&lt;br /&gt;
        parameters = {'PMC', 'pmc'}, &lt;br /&gt;
        link = 'PubMed Central',&lt;br /&gt;
        label = 'PMC',&lt;br /&gt;
        mode = 'manual',		-- changed to support unlinking of PMC identifier when article is embargoed&lt;br /&gt;
        prefix = '//www.ncbi.nlm.nih.gov/pmc/articles/PMC', &lt;br /&gt;
        suffix = &amp;quot; &amp;quot;,&lt;br /&gt;
        COinS = 'info:pmc',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['PMID'] = {&lt;br /&gt;
        parameters = {'PMID', 'pmid'}, &lt;br /&gt;
        link = 'PubMed Identifier',&lt;br /&gt;
        label = 'PMID',&lt;br /&gt;
        mode = 'manual',		-- changed from external manual to support PMID validation&lt;br /&gt;
        prefix = '//www.ncbi.nlm.nih.gov/pubmed/',&lt;br /&gt;
        COinS = 'info:pmid',&lt;br /&gt;
        encode = false,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['RFC'] = {&lt;br /&gt;
        parameters = {'RFC', 'rfc'}, &lt;br /&gt;
        link = 'Request for Comments',&lt;br /&gt;
        label = 'RFC',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//tools.ietf.org/html/rfc',&lt;br /&gt;
        COinS = 'info:rfc',&lt;br /&gt;
        encode = false,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['SSRN'] = {&lt;br /&gt;
        parameters = {'SSRN', 'ssrn'}, &lt;br /&gt;
        link = 'Social Science Research Network',&lt;br /&gt;
        label = 'SSRN',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = '//ssrn.com/abstract=', -- protocol relative tested 2013-09-04&lt;br /&gt;
        COinS = 'info:ssrn',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    },&lt;br /&gt;
    ['ZBL'] = {&lt;br /&gt;
        parameters = {'ZBL', 'zbl'}, &lt;br /&gt;
        link = 'Zentralblatt MATH',&lt;br /&gt;
        label = 'Zbl',&lt;br /&gt;
        mode = 'external',&lt;br /&gt;
        prefix = 'http://www.zentralblatt-math.org/zmath/en/search/?format=complete&amp;amp;q=an:',&lt;br /&gt;
        COinS = 'info:zbl',&lt;br /&gt;
        encode = true,&lt;br /&gt;
        separator = '&amp;amp;nbsp;',&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
--iso639-1 language codes and names.&lt;br /&gt;
citation_config.iso639_1 = {&lt;br /&gt;
    [&amp;quot;aa&amp;quot;]  = &amp;quot;Afar&amp;quot;,&lt;br /&gt;
    [&amp;quot;ab&amp;quot;]  = &amp;quot;Abkhazian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ae&amp;quot;]  = &amp;quot;Avestan&amp;quot;,&lt;br /&gt;
    [&amp;quot;af&amp;quot;]  = &amp;quot;Afrikaans&amp;quot;,&lt;br /&gt;
    [&amp;quot;ak&amp;quot;]  = &amp;quot;Akan&amp;quot;,&lt;br /&gt;
    [&amp;quot;am&amp;quot;]  = &amp;quot;Amharic&amp;quot;,&lt;br /&gt;
    [&amp;quot;an&amp;quot;]  = &amp;quot;Aragonese&amp;quot;,&lt;br /&gt;
    [&amp;quot;ar&amp;quot;]  = &amp;quot;Arabic&amp;quot;,&lt;br /&gt;
    [&amp;quot;as&amp;quot;]  = &amp;quot;Assamese&amp;quot;,&lt;br /&gt;
    [&amp;quot;av&amp;quot;]  = &amp;quot;Avaric&amp;quot;,&lt;br /&gt;
    [&amp;quot;ay&amp;quot;]  = &amp;quot;Aymara&amp;quot;,&lt;br /&gt;
    [&amp;quot;az&amp;quot;]  = &amp;quot;Azerbaijani&amp;quot;,&lt;br /&gt;
    [&amp;quot;ba&amp;quot;]  = &amp;quot;Bashkir&amp;quot;,&lt;br /&gt;
    [&amp;quot;be&amp;quot;]  = &amp;quot;Belarusian&amp;quot;,&lt;br /&gt;
    [&amp;quot;bg&amp;quot;]  = &amp;quot;Bulgarian&amp;quot;,&lt;br /&gt;
    [&amp;quot;bh&amp;quot;]  = &amp;quot;Bihari languages&amp;quot;,&lt;br /&gt;
    [&amp;quot;bi&amp;quot;]  = &amp;quot;Bislama&amp;quot;,&lt;br /&gt;
    [&amp;quot;bm&amp;quot;]  = &amp;quot;Bambara&amp;quot;,&lt;br /&gt;
    [&amp;quot;bn&amp;quot;]  = &amp;quot;Bengali&amp;quot;,&lt;br /&gt;
    [&amp;quot;bo&amp;quot;]  = &amp;quot;Tibetan&amp;quot;,&lt;br /&gt;
    [&amp;quot;br&amp;quot;]  = &amp;quot;Breton&amp;quot;,&lt;br /&gt;
    [&amp;quot;bs&amp;quot;]  = &amp;quot;Bosnian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ca&amp;quot;]  = &amp;quot;Catalan&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ca&amp;quot;]  = &amp;quot;Valencian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ce&amp;quot;]  = &amp;quot;Chechen&amp;quot;,&lt;br /&gt;
    [&amp;quot;ch&amp;quot;]  = &amp;quot;Chamorro&amp;quot;,&lt;br /&gt;
    [&amp;quot;co&amp;quot;]  = &amp;quot;Corsican&amp;quot;,&lt;br /&gt;
    [&amp;quot;cr&amp;quot;]  = &amp;quot;Cree&amp;quot;,&lt;br /&gt;
    [&amp;quot;cs&amp;quot;]  = &amp;quot;Czech&amp;quot;,&lt;br /&gt;
    [&amp;quot;cu&amp;quot;]  = &amp;quot;Church Slavic&amp;quot;,&lt;br /&gt;
--  [&amp;quot;cu&amp;quot;]  = &amp;quot;Old Slavonic&amp;quot;,&lt;br /&gt;
--  [&amp;quot;cu&amp;quot;]  = &amp;quot;Church Slavonic&amp;quot;,&lt;br /&gt;
--  [&amp;quot;cu&amp;quot;]  = &amp;quot;Old Bulgarian&amp;quot;,&lt;br /&gt;
--  [&amp;quot;cu&amp;quot;]  = &amp;quot;Old Church Slavonic&amp;quot;,&lt;br /&gt;
    [&amp;quot;cv&amp;quot;]  = &amp;quot;Chuvash&amp;quot;,&lt;br /&gt;
    [&amp;quot;cy&amp;quot;]  = &amp;quot;Welsh&amp;quot;,&lt;br /&gt;
    [&amp;quot;da&amp;quot;]  = &amp;quot;Danish&amp;quot;,&lt;br /&gt;
    [&amp;quot;de&amp;quot;]  = &amp;quot;German&amp;quot;,&lt;br /&gt;
    [&amp;quot;dv&amp;quot;]  = &amp;quot;Divehi&amp;quot;,&lt;br /&gt;
    [&amp;quot;dv&amp;quot;]  = &amp;quot;Dhivehi&amp;quot;,&lt;br /&gt;
    [&amp;quot;dv&amp;quot;]  = &amp;quot;Maldivian&amp;quot;,&lt;br /&gt;
    [&amp;quot;dz&amp;quot;]  = &amp;quot;Dzongkha&amp;quot;,&lt;br /&gt;
    [&amp;quot;ee&amp;quot;]  = &amp;quot;Ewe&amp;quot;,&lt;br /&gt;
    [&amp;quot;el&amp;quot;]  = &amp;quot;Modern Greek&amp;quot;,&lt;br /&gt;
    [&amp;quot;en&amp;quot;]  = &amp;quot;English&amp;quot;,&lt;br /&gt;
    [&amp;quot;eo&amp;quot;]  = &amp;quot;Esperanto&amp;quot;,&lt;br /&gt;
    [&amp;quot;es&amp;quot;]  = &amp;quot;Spanish&amp;quot;,&lt;br /&gt;
--  [&amp;quot;es&amp;quot;]  = &amp;quot;Castilian&amp;quot;,&lt;br /&gt;
    [&amp;quot;et&amp;quot;]  = &amp;quot;Estonian&amp;quot;,&lt;br /&gt;
    [&amp;quot;eu&amp;quot;]  = &amp;quot;Basque&amp;quot;,&lt;br /&gt;
    [&amp;quot;fa&amp;quot;]  = &amp;quot;Persian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ff&amp;quot;]  = &amp;quot;Fulah&amp;quot;,&lt;br /&gt;
    [&amp;quot;fi&amp;quot;]  = &amp;quot;Finnish&amp;quot;,&lt;br /&gt;
    [&amp;quot;fj&amp;quot;]  = &amp;quot;Fijian&amp;quot;,&lt;br /&gt;
    [&amp;quot;fo&amp;quot;]  = &amp;quot;Faroese&amp;quot;,&lt;br /&gt;
    [&amp;quot;fr&amp;quot;]  = &amp;quot;French&amp;quot;,&lt;br /&gt;
    [&amp;quot;fy&amp;quot;]  = &amp;quot;Western Frisian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ga&amp;quot;]  = &amp;quot;Irish&amp;quot;,&lt;br /&gt;
--  [&amp;quot;gd&amp;quot;]  = &amp;quot;Gaelic&amp;quot;,&lt;br /&gt;
    [&amp;quot;gd&amp;quot;]  = &amp;quot;Scottish Gaelic&amp;quot;,&lt;br /&gt;
    [&amp;quot;gl&amp;quot;]  = &amp;quot;Galician&amp;quot;,&lt;br /&gt;
    [&amp;quot;gn&amp;quot;]  = &amp;quot;Guarani&amp;quot;,&lt;br /&gt;
    [&amp;quot;gu&amp;quot;]  = &amp;quot;Gujarati&amp;quot;,&lt;br /&gt;
    [&amp;quot;gv&amp;quot;]  = &amp;quot;Manx&amp;quot;,&lt;br /&gt;
    [&amp;quot;ha&amp;quot;]  = &amp;quot;Hausa&amp;quot;,&lt;br /&gt;
    [&amp;quot;he&amp;quot;]  = &amp;quot;Hebrew&amp;quot;,&lt;br /&gt;
    [&amp;quot;hi&amp;quot;]  = &amp;quot;Hindi&amp;quot;,&lt;br /&gt;
    [&amp;quot;ho&amp;quot;]  = &amp;quot;Hiri Motu&amp;quot;,&lt;br /&gt;
    [&amp;quot;hr&amp;quot;]  = &amp;quot;Croatian&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ht&amp;quot;]  = &amp;quot;Haitian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ht&amp;quot;]  = &amp;quot;Haitian Creole&amp;quot;,&lt;br /&gt;
    [&amp;quot;hu&amp;quot;]  = &amp;quot;Hungarian&amp;quot;,&lt;br /&gt;
    [&amp;quot;hy&amp;quot;]  = &amp;quot;Armenian&amp;quot;,&lt;br /&gt;
    [&amp;quot;hz&amp;quot;]  = &amp;quot;Herero&amp;quot;,&lt;br /&gt;
    [&amp;quot;ia&amp;quot;]  = &amp;quot;Interlingua&amp;quot;,&lt;br /&gt;
    [&amp;quot;id&amp;quot;]  = &amp;quot;Indonesian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ie&amp;quot;]  = &amp;quot;Interlingue&amp;quot;,&lt;br /&gt;
    [&amp;quot;ie&amp;quot;]  = &amp;quot;Occidental&amp;quot;,&lt;br /&gt;
    [&amp;quot;ig&amp;quot;]  = &amp;quot;Igbo&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ii&amp;quot;]  = &amp;quot;Sichuan Yi&amp;quot;,&lt;br /&gt;
    [&amp;quot;ii&amp;quot;]  = &amp;quot;Nuosu&amp;quot;,&lt;br /&gt;
    [&amp;quot;ik&amp;quot;]  = &amp;quot;Inupiaq&amp;quot;,&lt;br /&gt;
    [&amp;quot;io&amp;quot;]  = &amp;quot;Ido&amp;quot;,&lt;br /&gt;
    [&amp;quot;is&amp;quot;]  = &amp;quot;Icelandic&amp;quot;,&lt;br /&gt;
    [&amp;quot;it&amp;quot;]  = &amp;quot;Italian&amp;quot;,&lt;br /&gt;
    [&amp;quot;iu&amp;quot;]  = &amp;quot;Inuktitut&amp;quot;,&lt;br /&gt;
    [&amp;quot;ja&amp;quot;]  = &amp;quot;Japanese&amp;quot;,&lt;br /&gt;
    [&amp;quot;jv&amp;quot;]  = &amp;quot;Javanese&amp;quot;,&lt;br /&gt;
    [&amp;quot;ka&amp;quot;]  = &amp;quot;Georgian&amp;quot;,&lt;br /&gt;
    [&amp;quot;kg&amp;quot;]  = &amp;quot;Kongo&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ki&amp;quot;]  = &amp;quot;Kikuyu&amp;quot;,&lt;br /&gt;
    [&amp;quot;ki&amp;quot;]  = &amp;quot;Gikuyu&amp;quot;,&lt;br /&gt;
--  [&amp;quot;kj&amp;quot;]  = &amp;quot;Kuanyama&amp;quot;,&lt;br /&gt;
    [&amp;quot;kj&amp;quot;]  = &amp;quot;Kwanyama&amp;quot;,&lt;br /&gt;
    [&amp;quot;kk&amp;quot;]  = &amp;quot;Kazakh&amp;quot;,&lt;br /&gt;
--  [&amp;quot;kl&amp;quot;]  = &amp;quot;Kalaallisut&amp;quot;,&lt;br /&gt;
    [&amp;quot;kl&amp;quot;]  = &amp;quot;Greenlandic&amp;quot;,&lt;br /&gt;
    [&amp;quot;km&amp;quot;]  = &amp;quot;Central Khmer&amp;quot;,&lt;br /&gt;
    [&amp;quot;kn&amp;quot;]  = &amp;quot;Kannada&amp;quot;,&lt;br /&gt;
    [&amp;quot;ko&amp;quot;]  = &amp;quot;Korean&amp;quot;,&lt;br /&gt;
    [&amp;quot;kr&amp;quot;]  = &amp;quot;Kanuri&amp;quot;,&lt;br /&gt;
    [&amp;quot;ks&amp;quot;]  = &amp;quot;Kashmiri&amp;quot;,&lt;br /&gt;
    [&amp;quot;ku&amp;quot;]  = &amp;quot;Kurdish&amp;quot;,&lt;br /&gt;
    [&amp;quot;kv&amp;quot;]  = &amp;quot;Komi&amp;quot;,&lt;br /&gt;
    [&amp;quot;kw&amp;quot;]  = &amp;quot;Cornish&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ky&amp;quot;]  = &amp;quot;Kirghiz&amp;quot;,&lt;br /&gt;
    [&amp;quot;ky&amp;quot;]  = &amp;quot;Kyrgyz&amp;quot;,&lt;br /&gt;
    [&amp;quot;la&amp;quot;]  = &amp;quot;Latin&amp;quot;,&lt;br /&gt;
    [&amp;quot;lb&amp;quot;]  = &amp;quot;Luxembourgish&amp;quot;,&lt;br /&gt;
--  [&amp;quot;lb&amp;quot;]  = &amp;quot;Letzeburgesch&amp;quot;,&lt;br /&gt;
    [&amp;quot;lg&amp;quot;]  = &amp;quot;Ganda&amp;quot;,&lt;br /&gt;
--  [&amp;quot;li&amp;quot;]  = &amp;quot;Limburgan&amp;quot;,&lt;br /&gt;
--  [&amp;quot;li&amp;quot;]  = &amp;quot;Limburger&amp;quot;,&lt;br /&gt;
    [&amp;quot;li&amp;quot;]  = &amp;quot;Limburgish&amp;quot;,&lt;br /&gt;
    [&amp;quot;ln&amp;quot;]  = &amp;quot;Lingala&amp;quot;,&lt;br /&gt;
    [&amp;quot;lo&amp;quot;]  = &amp;quot;Lao&amp;quot;,&lt;br /&gt;
    [&amp;quot;lt&amp;quot;]  = &amp;quot;Lithuanian&amp;quot;,&lt;br /&gt;
    [&amp;quot;lu&amp;quot;]  = &amp;quot;Luba-Katanga&amp;quot;,&lt;br /&gt;
    [&amp;quot;lv&amp;quot;]  = &amp;quot;Latvian&amp;quot;,&lt;br /&gt;
    [&amp;quot;mg&amp;quot;]  = &amp;quot;Malagasy&amp;quot;,&lt;br /&gt;
    [&amp;quot;mh&amp;quot;]  = &amp;quot;Marshallese&amp;quot;,&lt;br /&gt;
    [&amp;quot;mi&amp;quot;]  = &amp;quot;Maori&amp;quot;,&lt;br /&gt;
    [&amp;quot;mk&amp;quot;]  = &amp;quot;Macedonian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ml&amp;quot;]  = &amp;quot;Malayalam&amp;quot;,&lt;br /&gt;
    [&amp;quot;mn&amp;quot;]  = &amp;quot;Mongolian&amp;quot;,&lt;br /&gt;
    [&amp;quot;mr&amp;quot;]  = &amp;quot;Marathi&amp;quot;,&lt;br /&gt;
    [&amp;quot;ms&amp;quot;]  = &amp;quot;Malay&amp;quot;,&lt;br /&gt;
    [&amp;quot;mt&amp;quot;]  = &amp;quot;Maltese&amp;quot;,&lt;br /&gt;
    [&amp;quot;my&amp;quot;]  = &amp;quot;Burmese&amp;quot;,&lt;br /&gt;
    [&amp;quot;na&amp;quot;]  = &amp;quot;Nauru&amp;quot;,&lt;br /&gt;
    [&amp;quot;nb&amp;quot;]  = &amp;quot;Norwegian Bokmål&amp;quot;,&lt;br /&gt;
    [&amp;quot;nd&amp;quot;]  = &amp;quot;North Ndebele&amp;quot;,&lt;br /&gt;
    [&amp;quot;ne&amp;quot;]  = &amp;quot;Nepali&amp;quot;,&lt;br /&gt;
    [&amp;quot;ng&amp;quot;]  = &amp;quot;Ndonga&amp;quot;,&lt;br /&gt;
    [&amp;quot;nl&amp;quot;]  = &amp;quot;Dutch&amp;quot;,&lt;br /&gt;
--  [&amp;quot;nl&amp;quot;]  = &amp;quot;Flemish&amp;quot;,&lt;br /&gt;
    [&amp;quot;nn&amp;quot;]  = &amp;quot;Norwegian Nynorsk&amp;quot;,&lt;br /&gt;
    [&amp;quot;no&amp;quot;]  = &amp;quot;Norwegian&amp;quot;,&lt;br /&gt;
    [&amp;quot;nr&amp;quot;]  = &amp;quot;South Ndebele&amp;quot;,&lt;br /&gt;
    [&amp;quot;nv&amp;quot;]  = &amp;quot;Navajo&amp;quot;,&lt;br /&gt;
--  [&amp;quot;nv&amp;quot;]  = &amp;quot;Navaho&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ny&amp;quot;]  = &amp;quot;Chichewa&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ny&amp;quot;]  = &amp;quot;Chewa&amp;quot;,&lt;br /&gt;
    [&amp;quot;ny&amp;quot;]  = &amp;quot;Nyanja&amp;quot;,&lt;br /&gt;
    [&amp;quot;oc&amp;quot;]  = &amp;quot;Occitan&amp;quot;,&lt;br /&gt;
    [&amp;quot;oj&amp;quot;]  = &amp;quot;Ojibwa&amp;quot;,&lt;br /&gt;
    [&amp;quot;om&amp;quot;]  = &amp;quot;Oromo&amp;quot;,&lt;br /&gt;
    [&amp;quot;or&amp;quot;]  = &amp;quot;Oriya&amp;quot;,&lt;br /&gt;
    [&amp;quot;os&amp;quot;]  = &amp;quot;Ossetian&amp;quot;,&lt;br /&gt;
    [&amp;quot;os&amp;quot;]  = &amp;quot;Ossetic&amp;quot;,&lt;br /&gt;
--  [&amp;quot;pa&amp;quot;]  = &amp;quot;Panjabi&amp;quot;,&lt;br /&gt;
    [&amp;quot;pa&amp;quot;]  = &amp;quot;Punjabi&amp;quot;,&lt;br /&gt;
    [&amp;quot;pi&amp;quot;]  = &amp;quot;Pali&amp;quot;,&lt;br /&gt;
    [&amp;quot;pl&amp;quot;]  = &amp;quot;Polish&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ps&amp;quot;]  = &amp;quot;Pushto&amp;quot;,&lt;br /&gt;
    [&amp;quot;ps&amp;quot;]  = &amp;quot;Pashto&amp;quot;,&lt;br /&gt;
    [&amp;quot;pt&amp;quot;]  = &amp;quot;Portuguese&amp;quot;,&lt;br /&gt;
    [&amp;quot;qu&amp;quot;]  = &amp;quot;Quechua&amp;quot;,&lt;br /&gt;
    [&amp;quot;rm&amp;quot;]  = &amp;quot;Romansh&amp;quot;,&lt;br /&gt;
    [&amp;quot;rn&amp;quot;]  = &amp;quot;Rundi&amp;quot;,&lt;br /&gt;
    [&amp;quot;ro&amp;quot;]  = &amp;quot;Romanian&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ro&amp;quot;]  = &amp;quot;Moldavian&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ro&amp;quot;]  = &amp;quot;Moldovan&amp;quot;,&lt;br /&gt;
    [&amp;quot;ru&amp;quot;]  = &amp;quot;Russian&amp;quot;,&lt;br /&gt;
    [&amp;quot;rw&amp;quot;]  = &amp;quot;Kinyarwanda&amp;quot;,&lt;br /&gt;
    [&amp;quot;sa&amp;quot;]  = &amp;quot;Sanskrit&amp;quot;,&lt;br /&gt;
    [&amp;quot;sc&amp;quot;]  = &amp;quot;Sardinian&amp;quot;,&lt;br /&gt;
    [&amp;quot;sd&amp;quot;]  = &amp;quot;Sindhi&amp;quot;,&lt;br /&gt;
    [&amp;quot;se&amp;quot;]  = &amp;quot;Northern Sami&amp;quot;,&lt;br /&gt;
    [&amp;quot;sg&amp;quot;]  = &amp;quot;Sango&amp;quot;,&lt;br /&gt;
    [&amp;quot;si&amp;quot;]  = &amp;quot;Sinhala&amp;quot;,&lt;br /&gt;
--  [&amp;quot;si&amp;quot;]  = &amp;quot;Sinhalese&amp;quot;,&lt;br /&gt;
    [&amp;quot;sk&amp;quot;]  = &amp;quot;Slovak&amp;quot;,&lt;br /&gt;
    [&amp;quot;sl&amp;quot;]  = &amp;quot;Slovenian&amp;quot;,&lt;br /&gt;
    [&amp;quot;sm&amp;quot;]  = &amp;quot;Samoan&amp;quot;,&lt;br /&gt;
    [&amp;quot;sn&amp;quot;]  = &amp;quot;Shona&amp;quot;,&lt;br /&gt;
    [&amp;quot;so&amp;quot;]  = &amp;quot;Somali&amp;quot;,&lt;br /&gt;
    [&amp;quot;sq&amp;quot;]  = &amp;quot;Albanian&amp;quot;,&lt;br /&gt;
    [&amp;quot;sr&amp;quot;]  = &amp;quot;Serbian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ss&amp;quot;]  = &amp;quot;Swati&amp;quot;,&lt;br /&gt;
    [&amp;quot;st&amp;quot;]  = &amp;quot;Southern Sotho&amp;quot;,&lt;br /&gt;
    [&amp;quot;su&amp;quot;]  = &amp;quot;Sundanese&amp;quot;,&lt;br /&gt;
    [&amp;quot;sv&amp;quot;]  = &amp;quot;Swedish&amp;quot;,&lt;br /&gt;
    [&amp;quot;sw&amp;quot;]  = &amp;quot;Swahili&amp;quot;,&lt;br /&gt;
    [&amp;quot;ta&amp;quot;]  = &amp;quot;Tamil&amp;quot;,&lt;br /&gt;
    [&amp;quot;te&amp;quot;]  = &amp;quot;Telugu&amp;quot;,&lt;br /&gt;
    [&amp;quot;tg&amp;quot;]  = &amp;quot;Tajik&amp;quot;,&lt;br /&gt;
    [&amp;quot;th&amp;quot;]  = &amp;quot;Thai&amp;quot;,&lt;br /&gt;
    [&amp;quot;ti&amp;quot;]  = &amp;quot;Tigrinya&amp;quot;,&lt;br /&gt;
    [&amp;quot;tk&amp;quot;]  = &amp;quot;Turkmen&amp;quot;,&lt;br /&gt;
    [&amp;quot;tl&amp;quot;]  = &amp;quot;Tagalog&amp;quot;,&lt;br /&gt;
    [&amp;quot;tn&amp;quot;]  = &amp;quot;Tswana&amp;quot;,&lt;br /&gt;
    [&amp;quot;to&amp;quot;]  = &amp;quot;Tonga (Tonga Islands)&amp;quot;,&lt;br /&gt;
    [&amp;quot;tr&amp;quot;]  = &amp;quot;Turkish&amp;quot;,&lt;br /&gt;
    [&amp;quot;ts&amp;quot;]  = &amp;quot;Tsonga&amp;quot;,&lt;br /&gt;
    [&amp;quot;tt&amp;quot;]  = &amp;quot;Tatar&amp;quot;,&lt;br /&gt;
    [&amp;quot;tw&amp;quot;]  = &amp;quot;Twi&amp;quot;,&lt;br /&gt;
    [&amp;quot;ty&amp;quot;]  = &amp;quot;Tahitian&amp;quot;,&lt;br /&gt;
--  [&amp;quot;ug&amp;quot;]  = &amp;quot;Uighur&amp;quot;,&lt;br /&gt;
    [&amp;quot;ug&amp;quot;]  = &amp;quot;Uyghur&amp;quot;,&lt;br /&gt;
    [&amp;quot;uk&amp;quot;]  = &amp;quot;Ukrainian&amp;quot;,&lt;br /&gt;
    [&amp;quot;ur&amp;quot;]  = &amp;quot;Urdu&amp;quot;,&lt;br /&gt;
    [&amp;quot;uz&amp;quot;]  = &amp;quot;Uzbek&amp;quot;,&lt;br /&gt;
    [&amp;quot;ve&amp;quot;]  = &amp;quot;Venda&amp;quot;,&lt;br /&gt;
    [&amp;quot;vi&amp;quot;]  = &amp;quot;Vietnamese&amp;quot;,&lt;br /&gt;
    [&amp;quot;vo&amp;quot;]  = &amp;quot;Volapük&amp;quot;,&lt;br /&gt;
    [&amp;quot;wa&amp;quot;]  = &amp;quot;Walloon&amp;quot;,&lt;br /&gt;
    [&amp;quot;wo&amp;quot;]  = &amp;quot;Wolof&amp;quot;,&lt;br /&gt;
    [&amp;quot;xh&amp;quot;]  = &amp;quot;Xhosa&amp;quot;,&lt;br /&gt;
    [&amp;quot;yi&amp;quot;]  = &amp;quot;Yiddish&amp;quot;,&lt;br /&gt;
    [&amp;quot;yo&amp;quot;]  = &amp;quot;Yoruba&amp;quot;,&lt;br /&gt;
    [&amp;quot;za&amp;quot;]  = &amp;quot;Zhuang&amp;quot;,&lt;br /&gt;
--  [&amp;quot;za&amp;quot;]  = &amp;quot;Chuang&amp;quot;,&lt;br /&gt;
    [&amp;quot;zh&amp;quot;]  = &amp;quot;Chinese&amp;quot;,&lt;br /&gt;
    [&amp;quot;zu&amp;quot;]  = &amp;quot;Zulu&amp;quot;,&lt;br /&gt;
}&lt;br /&gt;
return citation_config;&lt;/div&gt;</summary>
		<author><name>Trappist the monk</name></author>	</entry>

	<entry>
		<id>http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Whitelist</id>
		<title>Module:Citation/CS1/Whitelist</title>
		<link rel="alternate" type="text/html" href="http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Whitelist"/>
				<updated>2014-03-30T12:23:27Z</updated>
		
		<summary type="html">&lt;p&gt;Trappist the monk: Synch from sandbox;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;--[[&lt;br /&gt;
Because a steady-state signal conveys no useful information, whitelist.basic_arguments[] list items now can have three values:&lt;br /&gt;
	true - these parameters are valid and supported parameters&lt;br /&gt;
	false - these parameters are deprecated but still supported&lt;br /&gt;
	nil - these parameters are no longer supported (when setting a parameter to nil, leave a comment stating the reasons for invalidating the parameter)&lt;br /&gt;
]]&lt;br /&gt;
whitelist = {&lt;br /&gt;
&lt;br /&gt;
basic_arguments = {&lt;br /&gt;
    ['accessdate'] = true,&lt;br /&gt;
    ['agency'] = true,&lt;br /&gt;
    ['airdate'] = true,&lt;br /&gt;
    ['albumlink'] = false,			-- deprecated; set to nil after 1 October 2014; a unique alias of titlelink used by old cite AV media notes&lt;br /&gt;
    ['albumtype'] = nil,			-- controled inappropriate functionality in the old cite AV media notes&lt;br /&gt;
    ['archivedate'] = true,&lt;br /&gt;
    ['archive-date'] = true,&lt;br /&gt;
    ['archiveurl'] = true,&lt;br /&gt;
    ['archive-url'] = true,&lt;br /&gt;
    ['article'] = true,&lt;br /&gt;
    ['artist'] = false,				-- deprecated; set to nil after 1 October 2014; a unique alias of others used by old cite AV media notes&lt;br /&gt;
    ['arxiv'] = true,&lt;br /&gt;
    ['ARXIV'] = true,&lt;br /&gt;
    ['asin'] = true,&lt;br /&gt;
    ['ASIN'] = true,&lt;br /&gt;
    ['asin-tld'] = true,&lt;br /&gt;
    ['ASIN-TLD'] = true,&lt;br /&gt;
    ['at'] = true,&lt;br /&gt;
    ['author'] = true,&lt;br /&gt;
    ['Author'] = true,&lt;br /&gt;
    ['author-first'] = true,&lt;br /&gt;
    ['authorformat'] = true,&lt;br /&gt;
    ['author-format'] = true,&lt;br /&gt;
    ['author-last'] = true,&lt;br /&gt;
    ['authorlink'] = true,&lt;br /&gt;
    ['author-link'] = true,&lt;br /&gt;
    ['authormask'] = true,&lt;br /&gt;
    ['author-mask'] = true,&lt;br /&gt;
    ['author-name-separator'] = true,&lt;br /&gt;
    ['authors'] = true,&lt;br /&gt;
    ['author-separator'] = true,&lt;br /&gt;
    ['bibcode'] = true,&lt;br /&gt;
    ['BIBCODE'] = true,&lt;br /&gt;
    ['booktitle'] = true,&lt;br /&gt;
	['callsign']=true,					-- cite interview&lt;br /&gt;
    ['cartography'] = true,&lt;br /&gt;
    ['chapter'] = true,&lt;br /&gt;
    ['chapterlink'] = true,&lt;br /&gt;
    ['chapterurl'] = true,&lt;br /&gt;
    ['chapter-url'] = true,&lt;br /&gt;
	['city']=true,						-- cite interview&lt;br /&gt;
    ['coauthor'] = false,&lt;br /&gt;
    ['coauthors'] = false,&lt;br /&gt;
    ['cointerviewers'] = false,			-- cite interview&lt;br /&gt;
    ['conference'] = true,&lt;br /&gt;
    ['conferenceurl'] = true,&lt;br /&gt;
    ['conference-url'] = true,&lt;br /&gt;
    ['contribution'] = true,&lt;br /&gt;
    ['contributionurl'] = true,&lt;br /&gt;
    ['contribution-url'] = true,&lt;br /&gt;
    ['date'] = true,&lt;br /&gt;
    ['day'] = false,&lt;br /&gt;
    ['deadurl'] = true,&lt;br /&gt;
    ['degree'] = true,&lt;br /&gt;
    ['department'] = true,&lt;br /&gt;
    ['dictionary'] = true,&lt;br /&gt;
    ['director'] = false,				-- deprecated; set to nil after 1 October 2014; a unique alias of author used by old cite DVD-notes&lt;br /&gt;
    ['displayauthors'] = true,&lt;br /&gt;
    ['display-authors'] = true,&lt;br /&gt;
    ['displayeditors'] = true,&lt;br /&gt;
    ['display-editors'] = true,&lt;br /&gt;
    ['docket'] = true,&lt;br /&gt;
    ['doi'] = true,&lt;br /&gt;
    ['DOI'] = true,&lt;br /&gt;
    ['DoiBroken'] = true,&lt;br /&gt;
    ['doi_brokendate'] = true,&lt;br /&gt;
    ['doi_inactivedate'] = true,&lt;br /&gt;
    ['edition'] = true,&lt;br /&gt;
    ['editor'] = true,&lt;br /&gt;
    ['Editor'] = true,&lt;br /&gt;
    ['editor-first'] = true,&lt;br /&gt;
    ['editorformat'] = true,&lt;br /&gt;
    ['editor-format'] = true,&lt;br /&gt;
    ['EditorGiven'] = true,&lt;br /&gt;
    ['editor-last'] = true,&lt;br /&gt;
    ['editorlink'] = true,&lt;br /&gt;
    ['editor-link'] = true,&lt;br /&gt;
    ['editormask'] = true,&lt;br /&gt;
    ['editor-mask'] = true,&lt;br /&gt;
    ['editor-name-separator'] = true,&lt;br /&gt;
    ['editors'] = true,&lt;br /&gt;
    ['editor-separator'] = true,&lt;br /&gt;
    ['EditorSurname'] = true,&lt;br /&gt;
    ['embargo'] = true,&lt;br /&gt;
    ['Embargo'] = true,&lt;br /&gt;
    ['encyclopaedia'] = true,&lt;br /&gt;
    ['encyclopedia'] = true,&lt;br /&gt;
    ['entry'] = true,&lt;br /&gt;
    ['episodelink'] = true,&lt;br /&gt;
    ['event'] = true,&lt;br /&gt;
    ['eventurl'] = true,&lt;br /&gt;
    ['first'] = true,&lt;br /&gt;
    ['format'] = true,&lt;br /&gt;
    ['given'] = true,&lt;br /&gt;
    ['host'] = true,&lt;br /&gt;
    ['id'] = true,&lt;br /&gt;
    ['ID'] = true,&lt;br /&gt;
    ['ignoreisbnerror'] = true,&lt;br /&gt;
    ['ignore-isbn-error'] = true,&lt;br /&gt;
    ['in'] = true,&lt;br /&gt;
    ['inset'] = true,&lt;br /&gt;
    ['institution'] = true,&lt;br /&gt;
	['interviewer'] = true,					--cite interview&lt;br /&gt;
    ['isbn'] = true,&lt;br /&gt;
    ['ISBN'] = true,&lt;br /&gt;
    ['isbn13'] = true,&lt;br /&gt;
    ['ISBN13'] = true,&lt;br /&gt;
    ['issn'] = true,&lt;br /&gt;
    ['ISSN'] = true,&lt;br /&gt;
    ['issue'] = true,&lt;br /&gt;
    ['jfm'] = true,&lt;br /&gt;
    ['JFM'] = true,&lt;br /&gt;
    ['journal'] = true,&lt;br /&gt;
    ['jstor'] = true,&lt;br /&gt;
    ['JSTOR'] = true,&lt;br /&gt;
    ['language'] = true,&lt;br /&gt;
    ['last'] = true,&lt;br /&gt;
    ['lastauthoramp'] = true,&lt;br /&gt;
    ['laydate'] = true,&lt;br /&gt;
    ['laysource'] = true,&lt;br /&gt;
    ['laysummary'] = true,&lt;br /&gt;
    ['layurl'] = true,&lt;br /&gt;
    ['lccn'] = true,&lt;br /&gt;
    ['LCCN'] = true,&lt;br /&gt;
    ['location'] = true,&lt;br /&gt;
    ['magazine'] = true,&lt;br /&gt;
    ['medium'] = true,&lt;br /&gt;
    ['minutes'] = true,&lt;br /&gt;
    ['month'] = false,&lt;br /&gt;
    ['mr'] = true,&lt;br /&gt;
    ['MR'] = true,&lt;br /&gt;
    ['name-separator'] = true,&lt;br /&gt;
    ['network'] = true,&lt;br /&gt;
    ['newspaper'] = true,&lt;br /&gt;
    ['nocat'] = true,&lt;br /&gt;
    ['nopp'] = true,&lt;br /&gt;
    ['notestitle'] = false,					-- deprecated; set to nil after 1 October 2014; a unique alias of chapter used by old cite AV media notes&lt;br /&gt;
    ['notracking'] = true,&lt;br /&gt;
    ['no-tracking'] = true,&lt;br /&gt;
    ['number'] = true,&lt;br /&gt;
    ['oclc'] = true,&lt;br /&gt;
    ['OCLC'] = true,&lt;br /&gt;
    ['ol'] = true,&lt;br /&gt;
    ['OL'] = true,&lt;br /&gt;
    ['origyear'] = true,&lt;br /&gt;
    ['osti'] = true,&lt;br /&gt;
    ['OSTI'] = true,&lt;br /&gt;
    ['others'] = true,&lt;br /&gt;
    ['p'] = true,&lt;br /&gt;
    ['page'] = true,&lt;br /&gt;
    ['pages'] = true,&lt;br /&gt;
    ['people'] = true,&lt;br /&gt;
    ['periodical'] = true,&lt;br /&gt;
    ['place'] = true,&lt;br /&gt;
    ['pmc'] = true,&lt;br /&gt;
    ['PMC'] = true,&lt;br /&gt;
    ['pmid'] = true,&lt;br /&gt;
    ['PMID'] = true,&lt;br /&gt;
    ['postscript'] = true,&lt;br /&gt;
    ['pp'] = true,&lt;br /&gt;
    ['PPPrefix'] = true,&lt;br /&gt;
    ['PPrefix'] = true,&lt;br /&gt;
	['program']=true,				-- cite interview&lt;br /&gt;
    ['publicationdate'] = true,&lt;br /&gt;
    ['publication-date'] = true,&lt;br /&gt;
    ['publicationplace'] = true,&lt;br /&gt;
    ['publication-place'] = true,&lt;br /&gt;
    ['publisher'] = true,&lt;br /&gt;
    ['publisherid'] = false,			-- deprecated; set to nil after 1 October 2014; a unique alias of others used by old cite AV media notes and old cite DVD-notes&lt;br /&gt;
    ['quotation'] = true,&lt;br /&gt;
    ['quote'] = true,&lt;br /&gt;
    ['ref'] = true,&lt;br /&gt;
    ['Ref'] = true,&lt;br /&gt;
    ['registration'] = true,&lt;br /&gt;
    ['rfc'] = true,&lt;br /&gt;
    ['RFC'] = true,&lt;br /&gt;
    ['scale'] = true,&lt;br /&gt;
    ['season'] = true,&lt;br /&gt;
    ['section'] = true,&lt;br /&gt;
    ['sectionurl'] = true,&lt;br /&gt;
    ['separator'] = true,&lt;br /&gt;
    ['series'] = true,&lt;br /&gt;
    ['serieslink'] = true,&lt;br /&gt;
    ['seriesno'] = true,&lt;br /&gt;
    ['seriesnumber'] = true,&lt;br /&gt;
    ['series-separator'] = true,&lt;br /&gt;
    ['ssrn'] = true,&lt;br /&gt;
    ['SSRN'] = true,&lt;br /&gt;
    ['station'] = true,&lt;br /&gt;
    ['subject'] = true,&lt;br /&gt;
    ['subjectlink'] = true,&lt;br /&gt;
    ['subscription'] = true,&lt;br /&gt;
    ['surname'] = true,&lt;br /&gt;
    ['template doc demo'] = true,&lt;br /&gt;
    ['time'] = true,&lt;br /&gt;
    ['timecaption'] = true,&lt;br /&gt;
    ['title'] = true,&lt;br /&gt;
    ['titlelink'] = true,&lt;br /&gt;
    ['titleyear'] = false,			-- deprecated; set to nil after 1 October 2014; a unique alias of origyear used by old cite DVD-notes&lt;br /&gt;
    ['trans_chapter'] = true,&lt;br /&gt;
    ['trans-chapter'] = true,&lt;br /&gt;
    ['transcript'] = true,&lt;br /&gt;
    ['transcripturl'] = true,&lt;br /&gt;
    ['transcript-url'] = true,&lt;br /&gt;
    ['trans_title'] = true,&lt;br /&gt;
    ['trans-title'] = true,&lt;br /&gt;
    ['type'] = true,&lt;br /&gt;
    ['url'] = true,&lt;br /&gt;
    ['URL'] = true,&lt;br /&gt;
    ['version'] = true,&lt;br /&gt;
    ['via'] = true,&lt;br /&gt;
    ['volume'] = true,&lt;br /&gt;
    ['website'] = true,&lt;br /&gt;
    ['work'] = true,&lt;br /&gt;
    ['year'] = true,&lt;br /&gt;
    ['zbl'] = true,&lt;br /&gt;
    ['ZBL'] = true,&lt;br /&gt;
},&lt;br /&gt;
&lt;br /&gt;
numbered_arguments = {&lt;br /&gt;
    ['author#'] = true,&lt;br /&gt;
    ['Author#'] = true,&lt;br /&gt;
    ['author-first#'] = true,&lt;br /&gt;
    ['author#-first'] = true,&lt;br /&gt;
    ['author-last#'] = true,&lt;br /&gt;
    ['author#-last'] = true,&lt;br /&gt;
    ['author-link#'] = true,&lt;br /&gt;
    ['author#link'] = true,&lt;br /&gt;
    ['author#-link'] = true,&lt;br /&gt;
    ['authorlink#'] = true,&lt;br /&gt;
    ['author-mask#'] = true,&lt;br /&gt;
    ['author#mask'] = true,&lt;br /&gt;
    ['author#-mask'] = true,&lt;br /&gt;
    ['authormask#'] = true,&lt;br /&gt;
    ['authors#'] = true,&lt;br /&gt;
    ['editor#'] = true,&lt;br /&gt;
    ['Editor#'] = true,&lt;br /&gt;
    ['editor-first#'] = true,&lt;br /&gt;
    ['editor#-first'] = true,&lt;br /&gt;
    ['EditorGiven#'] = true,&lt;br /&gt;
    ['editor-last#'] = true,&lt;br /&gt;
    ['editor#-last'] = true,&lt;br /&gt;
    ['editor-link#'] = true,&lt;br /&gt;
    ['editor#link'] = true,&lt;br /&gt;
    ['editor#-link'] = true,&lt;br /&gt;
    ['editorlink#'] = true,&lt;br /&gt;
    ['editor-mask#'] = true,&lt;br /&gt;
    ['editor#mask'] = true,&lt;br /&gt;
    ['editor#-mask'] = true,&lt;br /&gt;
    ['editormask#'] = true,&lt;br /&gt;
    ['editors#'] = true,&lt;br /&gt;
    ['EditorSurname#'] = true,&lt;br /&gt;
    ['first#'] = true,&lt;br /&gt;
    ['given#'] = true,&lt;br /&gt;
    ['last#'] = true,&lt;br /&gt;
    ['subject#'] = true,&lt;br /&gt;
    ['subjectlink#'] = true,&lt;br /&gt;
    ['surname#'] = true,&lt;br /&gt;
},&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
return whitelist;&lt;/div&gt;</summary>
		<author><name>Trappist the monk</name></author>	</entry>

	<entry>
		<id>http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Date_validation</id>
		<title>Module:Citation/CS1/Date validation</title>
		<link rel="alternate" type="text/html" href="http://wiki.evisionservices.com/index.php?title=Module:Citation/CS1/Date_validation"/>
				<updated>2014-03-30T12:22:02Z</updated>
		
		<summary type="html">&lt;p&gt;Trappist the monk: Synch from sandbox;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
-- returns a number according to the month in a date: 1 for January, etc.  Capitalization and spelling must be correct. If not a valid month, returns 0&lt;br /&gt;
function get_month_number (month)&lt;br /&gt;
local long_months = {['January']=1, ['February']=2, ['March']=3, ['April']=4, ['May']=5, ['June']=6, ['July']=7, ['August']=8, ['September']=9, ['October']=10, ['November']=11, ['December']=12};&lt;br /&gt;
local short_months = {['Jan']=1, ['Feb']=2, ['Mar']=3, ['Apr']=4, ['May']=5, ['Jun']=6, ['Jul']=7, ['Aug']=8, ['Sep']=9, ['Oct']=10, ['Nov']=11, ['Dec']=12};&lt;br /&gt;
local temp;&lt;br /&gt;
	temp=long_months[month];&lt;br /&gt;
	if temp then return temp; end				-- if month is the long-form name&lt;br /&gt;
	temp=short_months[month];&lt;br /&gt;
	if temp then return temp; end				-- if month is the short-form name&lt;br /&gt;
	return 0;									-- misspelled, improper case, or not a month name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- returns a number according to the sequence of seasons in a year: 1 for Winter, etc.  Capitalization and spelling must be correct. If not a valid season, returns 0&lt;br /&gt;
function get_season_number (season)&lt;br /&gt;
local season_list = {['Winter']=1, ['Spring']=2, ['Summer']=3, ['Fall']=4, ['Autumn']=4}&lt;br /&gt;
local temp;&lt;br /&gt;
	temp=season_list[season];&lt;br /&gt;
	if temp then return temp; end				-- if season is a valid name return its number&lt;br /&gt;
	return 0;									-- misspelled, improper case, or not a season name&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--returns true if month or season is valid (properly spelled, capitalized, abbreviated)&lt;br /&gt;
function is_valid_month_or_season (month_season)&lt;br /&gt;
	if 0 == get_month_number (month_season) then		-- if month text isn't one of the twelve months, might be a season&lt;br /&gt;
		if 0 == get_season_number (month_season) then	-- not a month, is it a season?&lt;br /&gt;
			return false;								-- return false not a month or one of the five seasons&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
	return true;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-- Function gets current year from the server and compares it to year from a citation parameter.  Years more than one year in the future are not acceptable.&lt;br /&gt;
function is_valid_year(year)&lt;br /&gt;
	if not is_set(year_limit) then&lt;br /&gt;
		year_limit = tonumber(os.date(&amp;quot;%Y&amp;quot;))+1;	-- global variable so we only have to fetch it once (os.date(&amp;quot;Y&amp;quot;) no longer works?)&lt;br /&gt;
	end&lt;br /&gt;
	return tonumber(year) &amp;lt;= year_limit;			-- false if year is in the future more than one year&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Returns true if day is less than or equal to the number of days in month and year is no farther into the future than next year; else returns false.&lt;br /&gt;
&lt;br /&gt;
Assumes Julian calendar prior to year 1582 and Gregorian calendar thereafter. Accounts for Julian calendar leap years before 1582 and Gregorian leap years after 1582.&lt;br /&gt;
Where the two calendars overlap (1582 to approximately 1923) dates are assumed to be Gregorian.&lt;br /&gt;
]]&lt;br /&gt;
function is_valid_date (year, month, day)&lt;br /&gt;
local days_in_month = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};&lt;br /&gt;
local month_length;&lt;br /&gt;
	if not is_valid_year(year) then	-- no farther into the future than next year&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if (2==month) then							-- if February&lt;br /&gt;
		month_length = 28;						-- then 28 days unless&lt;br /&gt;
		if 1582 &amp;gt; tonumber(year) then			-- Julian calendar&lt;br /&gt;
			if 0==(year%4) then&lt;br /&gt;
				month_length = 29;&lt;br /&gt;
			end&lt;br /&gt;
		else									-- Gregorian calendar&lt;br /&gt;
			if (0==(year%4) and (0~=(year%100) or 0==(year%400))) then	-- is a leap year?&lt;br /&gt;
				month_length = 29;				-- if leap year then 29 days in February&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	else&lt;br /&gt;
		month_length=days_in_month[month];&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	if tonumber (day) &amp;gt; month_length then&lt;br /&gt;
		return false;&lt;br /&gt;
	end&lt;br /&gt;
	return true;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Check a pair of months or seasons to see if both are valid members of a month or season pair.&lt;br /&gt;
&lt;br /&gt;
Month pairs are expected to be left to right, earliest to latest in time.  Similarly, seasons are also left to right, earliest to latest in time.  There is&lt;br /&gt;
an oddity with seasons.  Winter is assigned a value of 1, spring 2, ..., fall and autumn 4.  Because winter can follow fall/autumn at the end of a calender year, a special test&lt;br /&gt;
is made to see if |date=Fall-Winter yyyy (4-1) is the date.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function is_valid_month_season_range(range_start, range_end)&lt;br /&gt;
	local range_start_number = get_month_number (range_start);&lt;br /&gt;
	&lt;br /&gt;
	if 0 == range_start_number then								-- is this a month range?&lt;br /&gt;
		local range_start_number = get_season_number (range_start);		-- not a month; is it a season? get start season number&lt;br /&gt;
		local range_end_number = get_season_number (range_end);			-- get end season number&lt;br /&gt;
&lt;br /&gt;
		if 0 ~= range_start_number then							-- is start of range a season?&lt;br /&gt;
			if range_start_number &amp;lt; range_end_number then		-- range_start is a season&lt;br /&gt;
				return true;									-- return true when range_end is also a season and follows start season; else false&lt;br /&gt;
			end&lt;br /&gt;
			if 4 == range_start_number and 1 == range_end_number then	-- special case when range is Fall-Winter or Autumn-Winter&lt;br /&gt;
				return true;&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
		return false;		-- range_start is not a month or a season; or range_start is a season and range_end is not; or improper season sequence&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local range_end_number = get_month_number (range_end);		-- get end month number&lt;br /&gt;
	if range_start_number &amp;lt; range_end_number then				-- range_start is a month; does range_start precede range_end?&lt;br /&gt;
		return true;											-- if yes, return true&lt;br /&gt;
	end&lt;br /&gt;
	return false;												-- range_start month number is greater than or equal to range end number; or range end isn't a month&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Check date format to see that it is one of the formats approved by WP:DATESNO or WP:DATERANGE. Exception: only allowed range separator is endash.&lt;br /&gt;
Additionally, check the date to see that it is a real date: no 31 in 30-day months; no 29 February when not a leap year.  Months, both long-form and three&lt;br /&gt;
character abbreviations, and seasons must be spelled correctly. Future years beyond next year are not allowed.&lt;br /&gt;
&lt;br /&gt;
If the date fails the fomat tests, this function returns false and does not return values for anchor_year and COinS_date.  When this happens, the date parameter is&lt;br /&gt;
used in the COinS metadata and the CITEREF identifier gets its year from the year parameter if present otherwise CITEREF does not get a date value.&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
	date_string - date string from date-holding parameters (date, year, accessdate, embargo, archivedate, etc)&lt;br /&gt;
&lt;br /&gt;
Returns:&lt;br /&gt;
	false if date string is not a real date; else&lt;br /&gt;
	true, anchor_year, COinS_date&lt;br /&gt;
		anchor_year can be used in CITEREF anchors&lt;br /&gt;
		COinS_date is date_string without anchor_year disambiguator if any&lt;br /&gt;
]]&lt;br /&gt;
function check_date (date_string)&lt;br /&gt;
	local year;			-- assume that year2, months, and days are not used;&lt;br /&gt;
	local year2=0;		-- second year in a year range&lt;br /&gt;
	local month=0;&lt;br /&gt;
	local month2=0;		-- second month in a month range&lt;br /&gt;
	local day=0;&lt;br /&gt;
	local day2=0;		-- second day in a day range&lt;br /&gt;
	local anchor_year;&lt;br /&gt;
	local coins_date;&lt;br /&gt;
&lt;br /&gt;
	if date_string:match(&amp;quot;^%d%d%d%d%-%d%d%-%d%d$&amp;quot;) then										-- year-initial numerical year month day format&lt;br /&gt;
		year, month, day=string.match(date_string, &amp;quot;(%d%d%d%d)%-(%d%d)%-(%d%d)&amp;quot;);&lt;br /&gt;
		month=tonumber(month);&lt;br /&gt;
		if 12 &amp;lt; month or 1 &amp;gt; month or 1583 &amp;gt; tonumber(year) then return false; end			-- month number not valid or not Gregorian calendar&lt;br /&gt;
		anchor_year = year;&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^%a+ +[1-9]%d?, +[1-9]%d%d%d%a?$&amp;quot;) then						-- month-initial: month day, year&lt;br /&gt;
		month, day, anchor_year, year=string.match(date_string, &amp;quot;(%a+)%s*(%d%d?),%s*((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		if 0 == month then return false; end												-- return false if month text isn't one of the twelve months&lt;br /&gt;
				&lt;br /&gt;
	elseif date_string:match(&amp;quot;^%a+ +[1-9]%d?–[1-9]%d?, +[1-9]%d%d%d%a?$&amp;quot;) then				-- month-initial day range: month day–day, year; days are separated by endash&lt;br /&gt;
		month, day, day2, anchor_year, year=string.match(date_string, &amp;quot;(%a+) +(%d%d?)–(%d%d?), +((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if tonumber(day) &amp;gt;= tonumber(day2) then return false; end							-- date range order is left to right: earlier to later; dates may not be the same;&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		if 0 == month then return false; end												-- return false if month text isn't one of the twelve months&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d? +%a+ +[1-9]%d%d%d%a?$&amp;quot;) then						-- day-initial: day month year&lt;br /&gt;
		day, month, anchor_year, year=string.match(date_string, &amp;quot;(%d%d*)%s*(%a+)%s*((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		if 0 == month then return false; end												-- return false if month text isn't one of the twelve months&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d?–[1-9]%d? +%a+ +[1-9]%d%d%d%a?$&amp;quot;) then				-- day-range-initial: day–day month year; days are separated by endash&lt;br /&gt;
		day, day2, month, anchor_year, year=string.match(date_string, &amp;quot;(%d%d?)–(%d%d?) +(%a+) +((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if tonumber(day) &amp;gt;= tonumber(day2) then return false; end							-- date range order is left to right: earlier to later; dates may not be the same;&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		if 0 == month then return false; end												-- return false if month text isn't one of the twelve months&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d? +%a+ – [1-9]%d? +%a+ +[1-9]%d%d%d%a?$&amp;quot;) then		-- day initial month-day-range: day month - day month year; uses spaced endash&lt;br /&gt;
		day, month, day2, month2, anchor_year, year=date_string:match(&amp;quot;(%d%d?) +(%a+) – (%d%d?) +(%a+) +((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end	-- date range order is left to right: earlier to later;&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		month2 = get_month_number (month2);&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^%a+ +[1-9]%d? – %a+ +[1-9]%d?, +[1-9]%d%d%d%a?$&amp;quot;) then		-- month initial month-day-range: month day – month day, year;  uses spaced endash&lt;br /&gt;
		month, day, month2, day2, anchor_year, year=date_string:match(&amp;quot;(%a+) +(%d%d?) – (%a+) +(%d%d?), +((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if (not is_valid_month_season_range(month, month2)) or not is_valid_year(year) then return false; end&lt;br /&gt;
		month = get_month_number (month);&lt;br /&gt;
		month2 = get_month_number (month2);&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^Winter +[1-9]%d%d%d–[1-9]%d%d%d%a?$&amp;quot;) then					-- special case Winter year-year; year separated with unspaced endash&lt;br /&gt;
		year, anchor_year, year2=date_string:match(&amp;quot;Winter +(%d%d%d%d)–((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		anchor_year=year..'–'..anchor_year;													-- assemble anchor_year from both years&lt;br /&gt;
		if 1 ~= tonumber(year2) - tonumber(year) then return false; end						-- must be sequential years, left to right, earlier to later&lt;br /&gt;
		if not is_valid_year(year2) then return false; end									-- no year farther in the future than next year&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^%a+ +[1-9]%d%d%d% – %a+ +[1-9]%d%d%d%a?$&amp;quot;) then				-- month/season year - month/season year; separated by spaced endash&lt;br /&gt;
		month, year, month2, anchor_year, year2=date_string:match(&amp;quot;(%a+) +(%d%d%d%d) – (%a+) +((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		anchor_year=year..'–'..anchor_year;													-- assemble anchor_year from both years&lt;br /&gt;
		if tonumber(year) &amp;gt;= tonumber(year2) then return false; end							-- left to right, earlier to later, not the same&lt;br /&gt;
		if not is_valid_year(year2) then return false; end									-- no year farther in the future than next year&lt;br /&gt;
		if not((0 ~= get_month_number(month) and 0 ~= get_month_number(month2)) or 			-- both must be month year or season year, not mixed&lt;br /&gt;
			(0 ~= get_season_number(month) and 0 ~= get_season_number(month2))) then return false; end&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match (&amp;quot;^%a+–%a+ +[1-9]%d%d%d%a?$&amp;quot;) then								-- month/season range year; months separated by endash &lt;br /&gt;
		month, month2, anchor_year, year=date_string:match (&amp;quot;(%a+)–(%a+)%s*((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if (not is_valid_month_season_range(month, month2)) or (not is_valid_year(year)) then&lt;br /&gt;
			return false;&lt;br /&gt;
		end&lt;br /&gt;
		&lt;br /&gt;
	elseif date_string:match(&amp;quot;^%a+ +%d%d%d%d%a?$&amp;quot;) then							-- month/season year&lt;br /&gt;
		month, anchor_year, year=date_string:match(&amp;quot;(%a+)%s*((%d%d%d%d)%a?)&amp;quot;);&lt;br /&gt;
		if not is_valid_year(year) then return false; end&lt;br /&gt;
		if not is_valid_month_or_season (month) then return false; end&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d%d%d?–[1-9]%d%d%d?%a?$&amp;quot;) then				-- Year range: YYY-YYY or YYY-YYYY or YYYY–YYYY; separated by unspaced endash; 100-9999&lt;br /&gt;
		year, anchor_year, year2=date_string:match(&amp;quot;(%d%d%d%d?)–((%d%d%d%d?)%a?)&amp;quot;);&lt;br /&gt;
		anchor_year=year..'–'..anchor_year;										-- assemble anchor year from both years&lt;br /&gt;
		if tonumber(year) &amp;gt;= tonumber(year2) then return false; end				-- left to right, earlier to later, not the same&lt;br /&gt;
		if not is_valid_year(year2) then return false; end						-- no year farther in the future than next year&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d%d%d–%d%d%a?$&amp;quot;) then						-- Year range: YYYY–YY; separated by unspaced endash&lt;br /&gt;
		local century;&lt;br /&gt;
		year, century, anchor_year, year2=date_string:match(&amp;quot;((%d%d)%d%d)–((%d%d)%a?)&amp;quot;);&lt;br /&gt;
		anchor_year=year..'–'..anchor_year;										-- assemble anchor year from both years&lt;br /&gt;
		if 13 &amp;gt; tonumber(year2) then return false; end							-- don't allow 2003-05 which might be May 2003&lt;br /&gt;
		year2 = century..year2;													-- add the century to year2 for comparisons&lt;br /&gt;
		if tonumber(year) &amp;gt;= tonumber(year2) then return false; end				-- left to right, earlier to later, not the same&lt;br /&gt;
		if not is_valid_year(year2) then return false; end						-- no year farther in the future than next year&lt;br /&gt;
&lt;br /&gt;
	elseif date_string:match(&amp;quot;^[1-9]%d%d%d?%a?$&amp;quot;) then							-- year; here accept either YYY or YYYY&lt;br /&gt;
		anchor_year, year=date_string:match(&amp;quot;((%d%d%d%d?)%a?)&amp;quot;);&lt;br /&gt;
		if false == is_valid_year(year) then&lt;br /&gt;
			return false;&lt;br /&gt;
		end&lt;br /&gt;
&lt;br /&gt;
	else&lt;br /&gt;
		return false;											-- date format not one of the MOS:DATE approved formats&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	local result=true;											-- check whole dates for validity; assume true because not all dates will go through this test&lt;br /&gt;
	if 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 == day2 then		-- YMD (simple whole date)&lt;br /&gt;
		result=is_valid_date(year,month,day);&lt;br /&gt;
&lt;br /&gt;
	elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 == month2 and 0 ~= day2 then	-- YMD-d (day range)&lt;br /&gt;
		result=is_valid_date(year,month,day);&lt;br /&gt;
		result=result and is_valid_date(year,month,day2);&lt;br /&gt;
&lt;br /&gt;
	elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 == year2 and 0 ~= month2 and 0 ~= day2 then	-- YMD-md (day month range)&lt;br /&gt;
		result=is_valid_date(year,month,day);&lt;br /&gt;
		result=result and is_valid_date(year,month2,day2);&lt;br /&gt;
&lt;br /&gt;
	elseif 0 ~= year and 0 ~= month and 0 ~= day and 0 ~= year2 and 0 ~= month2 and 0 ~= day2 then	-- YMD-ymd (day month year range)&lt;br /&gt;
		result=is_valid_date(year,month,day);&lt;br /&gt;
		result=result and is_valid_date(year2,month2,day2);&lt;br /&gt;
	end&lt;br /&gt;
	&lt;br /&gt;
	if false == result then return false; end&lt;br /&gt;
																-- if here, then date_string is valid; get coins_date from date_string (leave CITEREF disambiguator) ...&lt;br /&gt;
	coins_date=date_string:match(&amp;quot;^(.+%d)%a?$&amp;quot;);				-- last character of valid disambiguatable date is always a digit&lt;br /&gt;
	coins_date= mw.ustring.gsub(coins_date, &amp;quot;–&amp;quot;, &amp;quot;-&amp;quot; );			-- ... and replace any ndash with a hyphen&lt;br /&gt;
	&lt;br /&gt;
	return true, anchor_year, coins_date;						-- format is good and date string represents a real date&lt;br /&gt;
end	&lt;br /&gt;
&lt;br /&gt;
--[[&lt;br /&gt;
Cycle the date-holding parameters in passed table date_parameters_list through check_date() to check compliance with MOS:DATE. For all valid dates, check_date() returns&lt;br /&gt;
true. The |date= parameter test is unique, it is the only date holding parameter from which values for anchor_year (used in CITEREF identifiers) and COinS_date (used in&lt;br /&gt;
the COinS metadata) are derived.  The |date= parameter is the only date-holding parameter that is allowed to contain the no-date keywords &amp;quot;n.d.&amp;quot; or &amp;quot;nd&amp;quot; (without quotes).&lt;br /&gt;
&lt;br /&gt;
Unlike most error messages created in this module, only one error message is created by this function. Because all of the date holding parameters are processed serially,&lt;br /&gt;
a single error message is created as the dates are tested.&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
function p.dates(date_parameters_list)&lt;br /&gt;
	local anchor_year;		-- will return as nil if the date being tested is not |date=&lt;br /&gt;
	local COinS_date;		-- will return as nil if the date being tested is not |date=&lt;br /&gt;
	local error_message =&amp;quot;&amp;quot;;&lt;br /&gt;
	local good_date=false;&lt;br /&gt;
	&lt;br /&gt;
	for k, v in pairs(date_parameters_list) do										-- for each date-holding parameter in the list&lt;br /&gt;
		if is_set(v) then															-- if the parameter has a value&lt;br /&gt;
			if v:match(&amp;quot;^c%. [1-9]%d%d%d?%a?$&amp;quot;) then								-- special case for c. year or with or without CITEREF disambiguator - only |date= and |year=&lt;br /&gt;
				local year = v:match(&amp;quot;c%. ([1-9]%d%d%d?)%a?&amp;quot;);						-- get the year portion so it can be tested&lt;br /&gt;
				if 'date'==k then&lt;br /&gt;
					anchor_year, COinS_date = v:match(&amp;quot;((c%. [1-9]%d%d%d?)%a?)&amp;quot;);	-- anchor year and COinS_date only from |date= parameter&lt;br /&gt;
					good_date = is_valid_year(year);&lt;br /&gt;
				elseif 'year'==k then&lt;br /&gt;
					good_date = is_valid_year(year);&lt;br /&gt;
				end&lt;br /&gt;
			elseif 'date'==k then													-- if the parameter is |date=&lt;br /&gt;
				if v:match(&amp;quot;n%.d%.%a?&amp;quot;) then										-- if |date=n.d. with or without a CITEREF disambiguator&lt;br /&gt;
					good_date, anchor_year, COinS_date = true, v:match(&amp;quot;((n%.d%.)%a?)&amp;quot;);	--&amp;quot;n.d.&amp;quot;; no error when date parameter is set to no date&lt;br /&gt;
				elseif v:match(&amp;quot;nd%a?$&amp;quot;) then										-- if |date=nd with or without a CITEREF disambiguator&lt;br /&gt;
					good_date, anchor_year, COinS_date = true, v:match(&amp;quot;((nd)%a?)&amp;quot;);	--&amp;quot;nd&amp;quot;;	no error when date parameter is set to no date&lt;br /&gt;
				else&lt;br /&gt;
					good_date, anchor_year, COinS_date = check_date (v);			-- go test the date&lt;br /&gt;
				end&lt;br /&gt;
			else																	-- any other date-holding parameter&lt;br /&gt;
				good_date = check_date (v);											-- go test the date&lt;br /&gt;
			end&lt;br /&gt;
			if false==good_date then												-- assemble one error message so we don't add the tracking category multiple times&lt;br /&gt;
				if is_set(error_message) then										-- once we've added the first portion of the error message ...&lt;br /&gt;
					error_message=error_message .. &amp;quot;, &amp;quot;;							-- ... add a comma space separator&lt;br /&gt;
				end&lt;br /&gt;
				error_message=error_message .. &amp;quot;&amp;amp;#124;&amp;quot; .. k .. &amp;quot;=&amp;quot;;				-- add the failed parameter&lt;br /&gt;
			end&lt;br /&gt;
		end&lt;br /&gt;
	end&lt;br /&gt;
&lt;br /&gt;
	return anchor_year, COinS_date, error_message;		-- and done&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p;&lt;/div&gt;</summary>
		<author><name>Trappist the monk</name></author>	</entry>

	</feed>