Module:Citation/CS1: திருத்தங்களுக்கு இடையிலான வேறுபாடு

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
Better version of strip_apostrophe_markup()?
Synch from sandbox;
வரிசை 37:
 
--[[
Categorize and emit an error message when the citation contains one or more deprecated parameters. Because deprecated parameters (currently |day=, |month=,
|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)
details of which parameter caused the error message are not provided. Only one error message is emitted regardless of the number of deprecated parameters in the citation.
வரிசை 50:
-- Populates numbered arguments in a message string using an argument table.
function substitute( msg, args )
-- return args and tostring( mw.message.newRawMessage( msg, args ) ) or msg;
return args and mw.message.newRawMessage( msg, args ):plain() or msg;
end
 
--[[--------------------------< K E R N _ Q U O T E S >--------------------------------------------------------
--[[
 
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.
This function will positive kern either single or double quotes:
"'Unkerned title with leading and trailing single quote marks'"
" 'Kerned title with leading and trailing single quote marks' " (in real life the kerning isn't as wide as this example)
Double single quotes (italic or bold wikimarkup) are not kerned.
 
Call this function for chapter titles, for website titles, etc; not for book titles.
 
]]
 
function kern_quotes (str)
local cap='';
local left='<span style="padding-left:0.2em;">%1</span>'; -- spacing to use when title contains leading single or double quote mark
local cap2='';
local right='<span style="padding-right:0.2em;">%1</span>'; -- spacing to use when title contains trailing single or double quote mark
ifcap, cap2 = str:match ("^([\"\'])([^\'].+)"); -- match leading double or single quote but not double single thenquotes
if is_set (cap) then
str = string.gsub( str, "^[\"\']", left, 1 ); -- replace (captured) leading single or double quote with left-side <span>
str = substitute (cfg.presentation['kern-left'], {cap, cap2});
end
 
if str:match ("[^\'][\"\']$") then
cap, cap2 = str:match ("^(.+[^\'])([\"\'])$")
str = string.gsub( str, "[\"\']$", right, 1 ); -- replace (captured) trailing single or double quote with right-side <span>
if is_set (cap) then
str = substitute (cfg.presentation['kern-right'], {cap, cap2});
end
return str;
வரி 110 ⟶ 118:
if is_set (name) then -- is prefix a proper ISO 639-1 language code?
script_value = script_value:gsub ('^%l%l%s*:%s*', ''); -- strip prefix from script
if inArray (lang, {'ar', 'ja', 'ko', 'he', 'zh'}) then -- is prefix one of these language codes?
if inArray (lang, {'ar', 'bs', 'dv', 'el', 'fa', 'hy', 'ja', 'ko', 'ku', 'he', 'ps', 'ru', 'sd', 'sr', 'th', 'uk', 'ug', 'yi', 'zh'}) then
table.insert( z.properties_cats, 'CS1 uses ' .. name .. '-language script ('..lang..')'); -- categorize in language-specific categories
else
வரி 120 ⟶ 129:
end
end
script_value = substitute (cfg.presentation['<bdi'], .. {lang .. '>' .., script_value .. '</bdi>'}); -- isolate incasein case script is rltrtl
 
return script_value;
வரி 141 ⟶ 150:
end
 
 
-- Wraps a string using a message_list configuration taking one argument
--[[--------------------------< W R A P _ S T Y L E >----------------------------------------------------------
function wrap( key, str, lower )
 
Applies styling to various parameters. Supplied string is wrapped using a message_list configuration taking one
argument; protects italic styled parameters. Additional text taken from citation_config.presentation - the reason
this function is similar to but separate from wrap_msg().
 
]]
 
function wrap_style (key, str)
if not is_set( str ) then
return "";
வரி 148 ⟶ 165:
str = safeforitalics( str );
end
 
if lower == true then
return substitute( cfg.messagespresentation[key]:lower(), {str} );
end
 
 
--[[--------------------------< W R A P _ M S G >--------------------------------------------------------------
 
Applies additional message text to various parameter values. Supplied string is wrapped using a message_list
configuration taking one argument. Supports lower case text for {{citation}} templates. Additional text taken
from citation_config.messages - the reason this function is similar to but separate from wrap_style().
 
]]
 
function wrap_msg (key, str, lower)
if not is_set( str ) then
return "";
end
if true == lower then
local msg;
msg = cfg.messages[key]:lower(); -- set the message to lower case before
str = substitute( msg, {str} ); -- including template text
return str;
else
return substitute( cfg.messages[key], {str} );
end
end
 
--[[--------------------------< F O R M A T _ C H A P T E R _ T I T L E >--------------------------------------
 
Format the three chapter parameters: |chapter=, |trans-chapter=, and |chapter-url= into a single Chapter meta-
parameter (chapter_url_source used for error messages).
 
]]
 
function format_chapter_title (chapter, transchapter, chapterurl, chapter_url_source)
local chapter_error = '';
if not is_set (chapter) then
chapter = ''; -- just to be safe for concatenation
if is_set (transchapter) then
chapter = wrap_style ('trans-quoted-title', transchapter);
chapter_error = " " .. seterror ('trans_missing_chapter');
end
if is_set (chapterurl) then
chapter = externallink (chapterurl, chapter, chapter_url_source); -- adds bare_url_missing_title error if appropriate
end
return chapter .. chapter_error;
else -- here when chapter is set
chapter = kern_quotes (chapter); -- if necessary, separate chapter title's leading and trailing quote marks from Module provided quote marks
chapter = wrap_style ('quoted-title', chapter);
if is_set (transchapter) then
transchapter = wrap_style ('trans-quoted-title', transchapter);
chapter = chapter .. ' ' .. transchapter;
end
if is_set (chapterurl) then
chapter = externallink (chapterurl, chapter); -- adds bare_url_missing_title error if appropriate
end
end
return chapter;
end
 
வரி 233 ⟶ 304:
end
 
--[[--------------------------< E R R O R C O M M E N T >------------------------------------------------------
-- Formats a comment for error trapping
 
Wraps error messages with css markup according to the state of hidden.
 
]]
function errorcomment( content, hidden )
return wrapsubstitute( hidden and cfg.presentation['hidden-error'] or cfg.presentation['visible-error'], content );
end
 
வரி 303 ⟶ 378:
label = URL;
if is_set( source ) then
error_str = seterror( 'bare_url_missing_title', { wrapwrap_style ( 'parameter', source ) }, false, " " );
else
error( cfg.messages["bare_url_no_origin"] );
வரி 314 ⟶ 389:
end
 
--[[--------------------------< N O W R A P _ D A T E >--------------------------------------------------------
-- Formats a link to Amazon
 
When date is YYYY-MM-DD format wrap in nowrap span: <span ...>YYYY-MM-DD</span>. When date is DD MMMM YYYY or is
MMMM DD, YYYY then wrap in nowrap span: <span ...>DD MMMM</span> YYYY or <span ...>MMMM DD,</span> YYYY
 
DOES NOT yet support MMMM YYYY or any of the date ranges.
 
]]
 
function nowrap_date (date)
local cap='';
local cap2='';
 
if date:match("^%d%d%d%d%-%d%d%-%d%d$") then
date = substitute (cfg.presentation['nowrap1'], date);
elseif date:match("%a+%s*%d%d?,%s*%d%d%d%d") or date:match ("%d%d?%s*%a+%s*%d%d%d%d") then
cap, cap2 = string.match (date, "^(.*)%s+(%d%d%d%d)$");
date = substitute (cfg.presentation['nowrap2'], {cap, cap2});
end
return date;
end
 
--[[--------------------------< A M A Z O N >------------------------------------------------------------------
 
Formats a link to Amazon. Do simple error checking: asin must be mix of 10 numeric or uppercase alpha
characters. If a mix, first character must be uppercase alpha; if all numeric, asins must be 10-digit
isbn. If 10-digit isbn, add a maintenance category so a bot or awb script can replace |asin= with |isbn=.
Error message if not 10 characters, if not isbn10, if mixed and first character is a digit.
 
]]
 
function amazon(id, domain)
local err_cat = ""
if checkisbn( id ) then -- see if asin value is a 10-digit isbn
 
table.insert( z.maintenance_cats, "CS1 maint: ASIN uses ISBN"); -- add to maint category so a bot or awb script can replace |asin= with |isbn=
if not id:match("^[%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u][%d%u]$") then
err_cat = ' ' .. seterror ('bad_asin'); -- asin is not a mix of 10 uppercase alpha and numeric characters
else
if id:match("^%d%d%d%d%d%d%d%d%d%d$") then -- if 10-digit numeric
if checkisbn( id ) then -- see if asin value is isbn10
table.insert( z.maintenance_cats, "CS1 maint: ASIN uses ISBN"); -- add to maint category
elseif not is_set (err_cat) then
err_cat = ' ' .. seterror ('bad_asin'); -- asin is not isbn10
end
elseif not id:match("^%u[%d%u]+$") then
err_cat = ' ' .. seterror ('bad_asin'); -- asin doesn't begin with uppercase alpha
end
end
if not is_set(domain) then
வரி 329 ⟶ 448:
return externallinkid({link = handler.link,
label=handler.label , prefix="//www.amazon."..domain.."/dp/",id=id,
encode=handler.encode, separator = handler.separator}) .. err_cat;
end
 
வரி 647 ⟶ 766:
return text
end
 
--[[--------------------------< M E S S A G E _ I D >----------------------------------------------------------
 
Validate and format a usenet message id. Simple error checking, looks for 'id-left@id-right' not enclosed in
'<' and/or '>' angle brackets.
 
]]
 
function message_id (id)
local handler = cfg.id_handlers['USENETID'];
 
text = externallinkid({link = handler.link, label = handler.label,
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode})
if not id:match('^.+@.+$') or not id:match('^[^<].*[^>]$')then -- doesn't have '@' or has one or first or last character is '< or '>'
text = text .. ' ' .. seterror( 'bad_message_id' ) -- add an error message if the message id is invalid
end
return text
end
 
 
 
--[[
வரி 1,018 ⟶ 1,159:
end
if ( "scap" == format ) then -- apply smallcaps formatting when authorformat or editorformat set to scap
-- if necessary wrap result in <span> tag to format in Small Caps
result = substitute (cfg.presentation['smallcaps'], result);
if ( "scap" == format ) then result =
'<span class="smallcaps" style="font-variant:small-caps">' .. result .. '</span>';
end
return result, count
வரி 1,088 ⟶ 1,228:
end
 
--[[--------------------------< B U I L D I D L I S T >--------------------------------------------------------
-- Takes a table of IDs and turns it into a table of formatted ID outputs.
Takes a table of IDs and turns it into a table of formatted ID outputs.
 
]]
function buildidlist( id_list, options )
local new_list, handler = {};
 
function fallback(k) return { __index = function(t,i) return cfg.id_handlers[k][i] end } end;
வரி 1,126 ⟶ 1,269:
end
table.insert( new_list, {handler.label, ISBN } );
elseif k == 'USENETID' then
table.insert( new_list, {handler.label, message_id( v ) } );
else
error( cfg.messages['unknown_manual_ID'] );
வரி 1,185 ⟶ 1,330:
for _, k in ipairs( error_list ) do
if error_str ~= "" then error_str = error_str .. cfg.messages['parameter-separator'] end
error_str = error_str .. wrapwrap_style ( 'parameter', k );
end
if #error_list > 1 then
வரி 1,192 ⟶ 1,337:
error_str = error_str .. cfg.messages['parameter-pair-separator'];
end
error_str = error_str .. wrapwrap_style ( 'parameter', selected );
table.insert( z.message_tail, { seterror( error_condition, {error_str}, true ) } );
end
வரி 1,220 ⟶ 1,365:
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:book";
OCinSoutput["rft.genre"] = "bookitem";
OCinSoutput["rft.btitleatitle"] = data.Chapter;
OCinSoutput["rft.atitlebtitle"] = data.Title;
elseif is_set(data.Periodical) then
OCinSoutput.rft_val_fmt = "info:ofi/fmt:kev:mtx:journal";
வரி 1,334 ⟶ 1,479:
the page is a mainspace page and the ISO639-1 code is not 'en'. Similarly, if the parameter is |language=Norwegian, it will be categorized in the same way.
 
TODO: Error message when language or language code is not ISO639-1?
]]
 
வரி 1,358 ⟶ 1,502:
if is_set (code) then
if 'no' == code then name = 'Norwegian' end; -- override wikimedia when code is 'no'
if 0 == namespace and 'en' ~= code then -- is this page main / article space and English not the language?
table.insert( z.properties_cats, 'CS1 ' .. name .. '-language sources (' .. code .. ')'); -- in main space and not English: categorize
end
end
else
return (" " .. wrap( 'language', name)); -- wrap with '(in ...)'
table.insert (z.maintenance_cats, 'CS1 maint: Unrecognized language'); -- add maintenance category when |language= does not appear to be ISO 639-1 language
end
return (" " .. wrap_msg ('language', name)); -- wrap with '(in ...)'
end
 
வரி 1,409 ⟶ 1,555:
local TitleLink = A['TitleLink'];
local Chapter = A['Chapter'];
local ChapterLink = A['ChapterLink']; -- deprecated
local TransChapter = A['TransChapter'];
local TitleType = A['TitleType'];
வரி 1,445 ⟶ 1,591:
local Language = A['Language'];
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local Ref = A['Ref'];
local DoiBroken = A['DoiBroken'];
வரி 1,453 ⟶ 1,600:
 
local ID_list = extractids( args );
 
--[[ Hide unfinished cite newsgroup code so that long delayed update can take place
-- special case for cite newsgroup which uses |id= for a usenet article or post id
-- |id= is not included in COinS so here we convert it to an ID that will be included in COinS
if ('newsgroup' == config.CitationClass) and (is_set (ID)) then
ID_list['USENETID']=ID; -- add this new 'id' to the list of IDs
ID = ''; -- and unset
end
]]
local Quote = A['Quote'];
local PostScript = A['PostScript'];
வரி 1,477 ⟶ 1,617:
local Callsign = A['Callsign'];
local City = A['City'];
local Cointerviewers = A['Cointerviewers']; -- deprecated
local Interviewer = A['Interviewer']; -- deprecated
local Program = A['Program'];
 
--local variables that are not cs1 parameters
local page_typeuse_lowercase; -- iscontrols thiscapitalization needed?of certain Doesn'tstatic appear to be used anywhere;text
local this_page = mw.title.getCurrentTitle(); -- also used for COinS and for language
local use_lowercase = ( sepc ~= '.' );
local this_page = mw.title.getCurrentTitle(); --Also used for COinS and for language
local anchor_year; -- used in the CITEREF identifier
local COinS_date; -- used in the COinS metadata
வரி 1,535 ⟶ 1,672:
 
|trans_title maps to |trans_chapter when |title is re-mapped
|url maps to |chapterurl when |title is remapped
 
All other combinations of |encyclopedia, |title, and |article are not modified
வரி 1,544 ⟶ 1,682:
Chapter = Title; -- |encyclopedia and |title are set so map |title to |article and |encyclopedia to |title
TransChapter = TransTitle;
ChapterURL = URL;
Title = Periodical;
Periodical = ''; -- redundant so unset
TransTitle = ''; -- redundant so unset
URL = ''; -- redundant so unset
end
else -- |title not set
வரி 1,568 ⟶ 1,708:
end
end
use_lowercase = ( sepc ~= '.' ); -- used to control capitalization for certain static text
 
-- check for special case where |separator=none
வரி 1,606 ⟶ 1,747:
end
 
if is_set(InterviewerOthers) then
if is_set(TitleType) then
Others = ' ' .. TitleType .. ' with ' .. InterviewerOthers;
TitleType = '';
else
Others = ' ' .. 'Interview with ' .. InterviewerOthers;
end
if is_set(Cointerviewers) then
Others = Others .. sepc .. ' ' .. Cointerviewers;
end
else
வரி 1,671 ⟶ 1,809:
-- end of {{cite episode}} stuff]]
 
-- 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.
if not is_set(Date) then
if is_set (Year) then
table.insert( z.maintenance_cats, "CS1 maint: Date and year"); -- add to maint category
end
else
Date = Year; -- promote Year to Date
Year = nil; -- make nil so Year as empty string isn't used for CITEREF
வரி 1,679 ⟶ 1,821:
if is_set(Month) then
Date = Month .. " " .. Date;
local Day = A['Day']
if is_set(Day) then Date = Day .. " " .. Date end
end
elseif is_set(PublicationDate) then -- use PublicationDate when |date= and |year= are not set
வரி 1,735 ⟶ 1,875:
end
]]
 
--[[ Hide unfinished cite newsgroup code so that long delayed update can take place
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername andto IDinclude som static text
if 'newsgroup' == config.CitationClass then
if is_set (PublisherName) then
PublisherName = '[[Newsgroup]]:&nbsp;' .. externallink( 'news:' .. PublisherName, PublisherName );
end
end
 
]]
 
 
வரி 1,750 ⟶ 1,890:
if not is_set(Authors) then
local Maximum = tonumber( A['DisplayAuthors'] );
 
if is_set (Maximum) then
-- Preserve old-style implicit et al.
if Maximum >= #a then -- if display-authors value greater than or equal to number of authors
if not is_set(Maximum) and #a == 9 then
table.insert( z.maintenance_cats, "CS1 maint: display-authors"); -- add maintenance category because display-authors parameter may be removed
Maximum = 8;
end
table.insert( z.message_tail, { seterror('implict_etal_author', {}, true ) } );
else
elseif not is_set(Maximum) then
Maximum = #a + 1; -- number of authors + 1
end
 
local control = {
sep = A["AuthorSeparator"] .. " ",
வரி 1,798 ⟶ 1,938:
maximum = Maximum,
lastauthoramp = LastAuthorAmp,
page_name = this_page.text -- get current page name so that we don't wikilink to it via authorlinkneditorlinkn
};
 
வரி 1,815 ⟶ 1,955:
Cartography = A['Cartography'];
if is_set( Cartography ) then
Cartography = sepc .. " " .. wrapwrap_msg ( 'cartography', Cartography, use_lowercase );
end
Scale = A['Scale'];
வரி 1,823 ⟶ 1,963:
end
Format = is_set(Format) and " (" .. Format .. ")" or "";
 
if not is_set(URL) and
not is_set(ChapterURL) and
not is_set(ArchiveURL) and
not is_set(ConferenceURL) and
வரி 1,835 ⟶ 1,976:
-- Test if accessdate is given without giving a URL
if is_set(AccessDate) and not is_set(ChapterURL)then -- ChapterURL may be set when the others are not set; TODO: move this to a separate test?
if is_set(AccessDate) then
table.insert( z.message_tail, { seterror( 'accessdate_missing_url', {}, true ) } );
AccessDate = '';
வரி 1,842 ⟶ 1,983:
-- Test if format is given without giving a URL
if is_set(Format) then
Format = Format .. seterror( 'format_missing_url', {'format', 'url'} );
end
end
 
-- Test if citation has no title
if not is_set(Title) and
வரி 1,855 ⟶ 1,996:
end
 
Format = is_set(Format) and " (" .. Format .. ")" or "";
local OriginalURL;
DeadURL = DeadURL:lower(); -- used later when assembling archived text
local OriginalURL = URL
DeadURL = DeadURL:lower();
if is_set( ArchiveURL ) then
if is_set ( DeadURL ~= "no" URL) then
OriginalURL = URL; -- save copy of original source URL
URL = ArchiveURL
if 'no' ~= DeadURL then -- if URL set then archive-url applies to it
URLorigin = A:ORIGIN('ArchiveURL')
URL = ArchiveURL -- swap-in the archive's url
URLorigin = A:ORIGIN('ArchiveURL') -- name of archive url parameter for error messages
end
elseif is_set (ChapterURL) then -- URL not set so if chapter-url is set apply archive url to it
OriginalURL = ChapterURL; -- save copy of source chapter's url for archive text
if 'no' ~= DeadURL then
ChapterURL = ArchiveURL -- swap-in the archive's url
URLorigin = A:ORIGIN('ArchiveURL') -- name of archive url parameter for error messages
end
end
end
-- Format chapter / article title
if is_set(Chapter) and is_set(ChapterLink) then
Chapter = "[[" .. ChapterLink .. "|" .. Chapter .. "]]";
end
 
if inArray(config.CitationClass, {"web","news","journal","pressrelease","conference","podcast", "newsgroup"}) or ('citation' == config.CitationClass and is_set (Periodical)) then
Chapter = kern_quotes (Chapter); -- if necessary, separate chapter title's leading and trailing quote marks from Module provided quote marks
if is_set (Chapter) or is_set (TransChapter) or is_set (ChapterURL)then -- chapter parameters not supported for these citation types
Chapter = wrap( 'quoted-title', Chapter );
table.insert( z.message_tail, { seterror( 'chapter_ignored', {}, true ) } ); -- add error message
TransChapter = wrap( 'trans-quoted-title', TransChapter );
Chapter = ''; -- set to empty string to be safe with concatenation
 
TransChapter = '';
local TransError = ""
ChapterURL = '';
if is_set(TransChapter) then
end
if not is_set(Chapter) then
else -- otherwise, format chapter / article title
TransError = " " .. seterror( 'trans_missing_chapter' ); -- add error message
Chapter = format_chapter_title (Chapter, TransChapter, ChapterURL, ChapterURLorigin);
else
if is_set (Chapter) then
TransChapter = " " .. TransChapter;
ChapterFormat = is_set(ChapterFormat) and " (" .. ChapterFormat .. ")" or "";
if is_set(ChapterFormat) and not is_set (ChapterURL) then -- Test if |chapter-format= is given without giving a |chapter-url=
ChapterFormat = ChapterFormat .. seterror( 'format_missing_url', {'chapter-format', 'chapter-url'} );
end
Chapter = Chapter .. ChapterFormat .. sepc .. ' ';
end
end
 
Chapter = Chapter .. TransChapter;
if is_set(Chapter) then
if not is_set(ChapterLink) then
if is_set(ChapterURL) then
Chapter = externallink( ChapterURL, Chapter ) .. TransError;
if not is_set(URL) then
Chapter = Chapter .. Format;
Format = "";
end
elseif is_set(URL) then
Chapter = externallink( URL, Chapter ) .. TransError .. Format;
URL = "";
Format = "";
else
Chapter = Chapter .. TransError;
end
elseif is_set(ChapterURL) then
Chapter = Chapter .. " " .. externallink( ChapterURL, nil, ChapterURLorigin ) .. TransError; -- ChapterURLorigin holds the name of parameter
else
Chapter = Chapter .. TransError;
end
Chapter = Chapter .. sepc .. " " -- with end-space
elseif is_set(ChapterURL) then
Chapter = " " .. externallink( ChapterURL, nil, ChapterURLorigin ) .. sepc .. " ";
end
-- Format main title.
if is_set(TitleLink) and is_set(Title) then
வரி 1,916 ⟶ 2,038:
end
 
if inArray(config.CitationClass, {"web","news","journal","pressrelease","conference","podcast", "newsgroup"}) or ('citation' == config.CitationClass and is_set (Periodical)) then
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from Module provided quote marks
Title = wrapwrap_style ( 'quoted-title', Title );
 
Title = script_concatenate (Title, ScriptTitle); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle = wrapwrap_style ( 'trans-quoted-title', TransTitle );
-- Chapter = ''; -- chapter not allowed - disabled because doing this here doesn't display error msg and promoted url is lost
else
Title = wrapwrap_style ( 'italic-title', Title );
Title = script_concatenate (Title, ScriptTitle); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle = wrapwrap_style ( 'trans-italic-title', TransTitle );
end
 
வரி 1,950 ⟶ 2,072:
 
if is_set(Place) then
Place = " " .. wrapwrap_msg ( 'written', Place, use_lowercase ) .. sepc .. " ";
end
வரி 2,011 ⟶ 2,133:
if first_set( Pages, Page, At ) ~= nil or sepc ~= '.' then
if is_set( Section ) then
Section = ", " .. wrapwrap_msg ( 'section', Section, true );
end
if is_set( Inset ) then
Inset = ", " .. wrapwrap_msg ( 'inset', Inset, true );
end
else
if is_set( Section ) then
Section = sepc .. " " .. wrapwrap_msg ( 'section', Section, use_lowercase );
if is_set( Inset ) then
Inset = ", " .. wrapwrap_msg ( 'inset', Inset, true );
end
elseif is_set( Inset ) then
Inset = sepc .. " " .. wrapwrap_msg ( 'inset', Inset, use_lowercase );
end
end
வரி 2,051 ⟶ 2,173:
 
TitleNote = is_set(TitleNote) and (sepc .. " " .. TitleNote) or "";
Edition = is_set(Edition) and (" " .. wrapwrap_msg ( 'edition', Edition )) or "";
Issue = is_set(Issue) and (" (" .. Issue .. ")") or "";
Series = is_set(Series) and (sepc .. " " .. Series) or "";
வரி 2,064 ⟶ 2,186:
end
 
--[[ This code commented out while discussion continues until after week of 2014-03-23 live module update;
if is_set(Volume) then
if ( mw.ustring.len(Volume) > 4 )
then Volume = sepc .. " " .. Volume;
else
Volume = " <b>" .. hyphentodash(Volume) .. "</b>";
if is_set(Series) then Volume = sepc .. Volume;
end
end
end
]]
------------------------------------ totally unrelated data
--[[ Loosely mimic {{subscription required}} template; Via parameter identifies a delivery source that is not the publisher; these sources often, but not always, exist
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).
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.
]]
if is_set(Via) then
Via = " " .. wrapwrap_msg ( 'via', Via );
end
 
--[[
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.
 
]]
if is_set(SubscriptionRequired) then
SubscriptionRequired = sepc .. " " .. cfg.messages['subscription']; --here whensubscription 'via' parameter not used but 'subscription'required ismessage
elseif is_set(RegistrationRequired) then
SubscriptionRequired = sepc .. " " .. cfg.messages['registration']; --here whenregistration 'via' and 'subscription' parameters not used but 'registration'required ismessage
end
 
if is_set(AccessDate) then
local retrv_text = " " .. cfg.messages['retrieved']
 
if (sepc ~= ".") then retrv_text = retrv_text:lower() end
AccessDate = nowrap_date (AccessDate); -- wrap in nowrap span if date in appropriate format
AccessDate = '<span class="reference-accessdate">' .. sepc
if (sepc ~= ".") then retrv_text = retrv_text:lower() end -- if 'citation', lower case
.. substitute( retrv_text, {AccessDate} ) .. '</span>'
AccessDate = substitute (retrv_text, AccessDate); -- add retrieved text
-- neither of these work; don't know why; it seems that substitute() isn't being called
AccessDate = substitute (cfg.presentation['accessdate'], {sepc, AccessDate}); -- allow editors to hide accessdates
end
வரி 2,103 ⟶ 2,217:
end
 
ID_list = buildidlist( ID_list, {DoiBroken = DoiBroken, ASINTLD = ASINTLD, IgnoreISBN = IgnoreISBN, Embargo=Embargo} );
 
வரி 2,114 ⟶ 2,227:
Quote = Quote:sub(2,-2);
end
Quote = sepc .." " .. wrap(wrap_style ('quoted-text', Quote ); -- wrap in <q>...</q> tags
PostScript = ""; -- CS1 does not supply terminal punctuation when |quote= is set
end
வரி 2,185 ⟶ 2,298:
if is_set(PublicationDate) then
if is_set(Publisher) then
Publisher = Publisher .. ", " .. wrapwrap_msg ( 'published', PublicationDate );
else
Publisher = PublicationDate;
வரி 2,195 ⟶ 2,308:
else
if is_set(PublicationDate) then
PublicationDate = " (" .. wrapwrap_msg ( 'published', PublicationDate ) .. ")";
end
if is_set(PublisherName) then
வரி 2,213 ⟶ 2,326:
if is_set(Periodical) then
if is_set(Title) or is_set(TitleNote) then
Periodical = sepc .. " " .. wrapwrap_style ( 'italic-title', Periodical )
else
Periodical = wrapwrap_style ( 'italic-title', Periodical )
end
end
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது