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

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
Synch from sandbox;
Synch from sandbox;
வரிசை 41:
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.
]]
function deprecated_parameter(name)
if true ~= Page_in_deprecated_cat then -- if we haven't been here before then set a
Page_in_deprecated_cat=true; -- sticky flag so that if there are more than one deprecated parameter the category is added only once
table.insert( z.message_tail, { seterror( 'deprecated_params', {name}, true ) } ); -- add error message
end
end
வரிசை 288:
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
வரிசை 297:
if true == state then return true; end -- valid actively supported parameter
if false == state then
deprecated_parameter (name); -- parameter is deprecated but still supported
return true;
end
வரிசை 428:
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[%ddX]$") then -- if 10-digit numeric (or 9 digits with terminal X)
if checkisbn( id ) then -- see if asin value is isbn10
table.insert( z.maintenance_cats, "CS1 maint: ASIN uses ISBN"); -- add to maint category
வரிசை 451:
end
 
--[[--------------------------< A R X I V >--------------------------------------------------------------------
--[[
 
format and error check arXiv identifier. There are two valid forms of the identifier:
See: http://arxiv.org/help/arxiv_identifier
 
format and error check arXiv identifier. There are three valid forms of the identifier:
the first form, valid only between date codes 9108 and 0703 is:
arXiv:<archive>.<class>/<date code><number><version>
வரி 463 ⟶ 466:
<version> is a 1 or more digit number preceded with a lowercase v; no spaces (undocumented)
the second form, valid from April 2007 through December 2014 is:
arXiv:<date code>.<number><version>
where:
வரி 469 ⟶ 472:
<number> is a four-digit number
<version> is a 1 or more digit number preceded with a lowercase v; no spaces
 
the third form, valid from January 2015 is:
arXiv:<date code>.<number><version>
where:
<date code> and <version> are as defined for 0704-1412
<number> is a five-digit number
]]
 
வரி 476 ⟶ 485:
local err_cat = ""
year, month, version =if id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d$") or id:match("^%a[v%a%.%-]+/[90]%d[01]*)%d%d%d%dv%d+$"); then -- test for the 9108-0703 format w/ & w/o version
year, month = id:match("^%a[%a%.%-]+/([90]%d)([01]%d)%d%d%d[v%d]*$");
if not year then -- arXiv id is not proper 9108-0703 form
year = tonumber(year);
year, month, version = id:match("^(%d%d)([01]%d)%.%d%d%d%d([v%d]*)$"); -- test for the 0704- format
month = tonumber(month);
if not year then
if ((not (90 < year or 8 > year)) or (1 > month or 12 < month)) or -- if invalid year or invalid month
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- arXiv id doesn't match either format
((91 == year and 7 > month) or (7 == year and 3 < month)) then -- if years ok, are starting and ending months ok?
else -- id is the 0704- format
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- set error message
year = tonumber(year);
month = tonumber(month);
if ((7 > year) or (1 > month and 12 < month)) or -- is year invalid or is month invalid? (doesn't test for future years)
((7 == year) and (4 > month)) or -- when year is 07, is month invalid (before April)?
is_set (version) and nil == version:match("v%d+") then -- is version proper format of single 'v' followed by digits?
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- set error message
end
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%dv%d+$") then -- test for the 0704-1412 w/ & w/o version
else -- id is the 9108-0703 format; are the date values ok
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((917 > year) andor 7(14 < year) or (1 > month andor 12 < month)) or -- if invalidis year invalid or invalidis month invalid? (doesn't test for future years)
((917 == year) and 8(4 > month)) or (7 == year and 3 < month))then --or -- ifwhen yearsyear okis 07, areis startingmonth andinvalid ending(before months okApril)?
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- set error message
is_set (version) and nil == version:match("v%d+") then -- is version proper format of single 'v' followed by digits?
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- set error message
end
elseif id:match("^%d%d[01]%d%.%d%d%d%d%d$") or id:match("^%d%d[01]%d%.%d%d%d%d%dv%d+$") then -- test for the 1501- format w/ & w/o version
year, month = id:match("^(%d%d)([01]%d)%.%d%d%d%d%d[v%d]*$");
year = tonumber(year);
month = tonumber(month);
if ((15 > year) or (1 > month or 12 < month)) then -- is year invalid or is month invalid? (doesn't test for future years)
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- set error message
end
else
err_cat = ' ' .. seterror( 'bad_arxiv' ); -- arXiv id doesn't match any format
end
 
வரி 503 ⟶ 515:
prefix=handler.prefix,id=id,separator=handler.separator, encode=handler.encode}) .. err_cat;
end
 
 
--[[
வரி 789 ⟶ 802:
 
 
--[[--------------------------< S E T _ T I T L E T Y P E >----------------------------------------------------
--[[
 
This function sets default title types (equivalent to the citation including |type=<default value>) for those citations that have defaults.
Also handles the special case where it is desirable to omit the title type from the rendered citation (|type=none).
 
]]
function set_titletype(cite_class, title_type)
வரி 803 ⟶ 818:
if "AV-media-notes" == cite_class or "DVD-notes" == cite_class then -- if this citation is cite AV media notes or cite DVD notes
return "Media notes"; -- display AV media notes / DVD media notes annotation
 
elseif "mailinglist" == cite_class then -- if this citation is cite mailing list
return "Mailing list"; -- display mailing list annotation
 
elseif "podcast" == cite_class then -- if this citation is cite podcast
வரி 810 ⟶ 828:
return "Press release"; -- display press release annotation
 
elseif "report" == cite_class then -- if this citation is cite report
return "Report"; -- display report annotation
elseif "techreport" == cite_class then -- if this citation is cite techreport
return "Technical report"; -- display techreport annotation
வரி 1,009 ⟶ 1,030:
end
 
--[[--------------------------< S A F E J O I N >--------------------------------------------------------------
--[[
 
Joins a sequence of strings together while checking for duplicate separation characters.
 
TODO: safejoin() has a flaw where it won't remove the duplicate character from a |title= / |url= combination.
This is because by the time we get here, |title=http://somesite.com and |title=Document Title. have been combined:
[http://somesite.com and ''Document Title.'']
so that now, the last character is not sepc but is ] (unless sepc == ']' which breaks the external link)
]]
function safejoin( tbl, duplicate_char )
வரி 1,026 ⟶ 1,044:
]]
local str = ''; -- the output string
local comp = ''; -- what does 'comp' mean?
local end_chr = '';
local trim;
வரி 1,033 ⟶ 1,051:
if value == nil then value = ''; end
if str == '' then -- if output string is empty
str = value; -- assign value to it (first time through the loop)
str = value;
elseif value ~= '' then
if value:sub(1,1) == '<' then -- Special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" ); -- remove html markup (<span>string</span> -> string)
-- Special case of values enclosed in spans and other markup.
comp = value:gsub( "%b<>", "" );
else
comp = value;
end
-- typically duplicate_char is sepc
if comp:sub(1,1) == duplicate_char then -- is first charactier same as duplicate_char? why test first character?
-- Because individual string segments often (always?) begin with terminal punct for th
-- preceding segment: 'First element' .. 'sepc next element' .. etc?
trim = false;
end_chr = str:sub(-1,-1); -- get the last character of the output string
-- str = str .. "<HERE(enchr=" .. end_chr.. ")" -- debug stuff?
if end_chr == duplicate_char then -- if same as separator
str = str:sub(1,-2); -- remove it
elseif end_chr == "'" then -- if it might be wikimarkup
if str:sub(-3,-1) == duplicate_char .. "''" then -- if last three chars of str are sepc''
str = str:sub(1, -4) .. "''"; -- remove them and add back ''
elseif str:sub(-5,-1) == duplicate_char .. "]]''" then -- if last five chars of str are sepc]]''
trim = true; -- why? why do this and next differently from previous?
elseif str:sub(-4,-1) == duplicate_char .. "]''" then -- if last four chars of str are sepc]''
trim = true; -- same question
end
elseif end_chr == "]" then -- if it might be wikimarkup
if str:sub(-3,-1) == duplicate_char .. "]]" then -- if last three chars of str are sepc]] wikilink
trim = true;
elseif str:sub(-42,-1) == duplicate_char .. "]''" then -- if last two chars of str are sepc] external link
trim = true;
end
elseif end_chr == "]" then
if str:sub(-3,-1) == duplicate_char .. "]]" then
trim = true;
elseif str:sub(-24,-1) == duplicate_char .. "'']" then -- normal case when |url=something & |title=Title.
trim = true;
end
elseif end_chr == " " then -- if last char of output string is a space
if str:sub(-2,-1) == duplicate_char .. " " then -- if last two chars of str are <sepc><space>
str = str:sub(1,-3); -- remove them both
end
end
 
if trim then
if value ~= comp then -- value does not equal comp when value contains html markup
local dup2 = duplicate_char;
if dup2:match( "%A" ) then dup2 = "%" .. dup2; end -- if duplicate_char not a letter then escape it
value = value:gsub( "(%b<>)" .. dup2, "%1", 1 ) -- remove duplicate_char if it follows html markup
else
value = value:sub( 2, -1 ); -- remove duplicate_char when it is first character
end
end
end
str = str .. value; --add it to the output string
end
end
வரி 1,100 ⟶ 1,121:
-- Formats a list of people (e.g. authors / editors)
function listpeople(control, people)
local sep = control.sep;
local namesep = control.namesep;
local format = control.format
local maximum = control.maximum
வரி 1,107 ⟶ 1,128:
local text = {}
local etal = false;
if 'vanc' == format then -- Vancouver-like author/editor name styling?
sep = ','; -- name-list separator between authors is a comma
namesep = ' '; -- last/first separator is a space
else
sep = ';' -- name-list separator between authors is a semicolon
namesep = ', ' -- last/first separator is <comma><space>
end
if sep:sub(-1,-1) ~= " " then sep = sep .. " " end
வரி 1,138 ⟶ 1,167:
end
 
if is_set(person.link) and ((nil ~= person.link:find("//")) thenor one(nil ~= one person.. link:find(" [%[%]]" .. seterror( 'bad_authorlink' ))) end -- check for url in author link;then
one = one .. " " .. seterror( 'bad_authorlink' ) end -- url or wikilink in author link;
end
table.insert( text, one )
வரி 1,159 ⟶ 1,189:
end
if ( "scap" == format ) then -- apply smallcaps formatting when authorformat or editorformat set to scap
result = substitute (cfg.presentation['smallcaps'], result);
end
return result, count
end
 
--[[--------------------------< A N C H O R I D >--------------------------------------------------------------
-- Generates a CITEREF anchor ID.
Generates a CITEREF anchor ID if we have at least one name or a date. Otherwise returns an empty string.
 
]]
 
function anchorid( options )
returnlocal "CITEREF"id ..= table.concat( options ); -- concatenate names and year for CITEREF id
if is_set (id) then -- if concatenation is not an empty string
return "CITEREF" .. id; -- add the CITEREF portion
else
return ''; -- return an empty string; no reason to include CITEREF id in this citation
end
end
 
வரி 1,444 ⟶ 1,480:
 
function get_iso639_code (lang)
if 'norwegian' == lang:lower() then -- special case related to Wikimedia remap of code 'no' at Extension:CLDR
if 'Norwegian' == lang then
return lang'Norwegian', 'no'; -- specialMake casesure relatedrendered toversion Wikimedia remap of code 'no'is atproperly Extension:CLDRcapitalized
end
வரி 1,511 ⟶ 1,547:
end
 
--[[--------------------------< G E T _ S E T T I N G S _ F R O M _ C I T E _ C L A S S >----------------------
When |mode= is not set or when its value is invalid, use config.CitationClass and parameter values to establish
rendered style.
 
]]
 
function get_settings_from_cite_class (ps, ref, cite_class)
local sep;
if (cite_class == "citation") then -- for citation templates (CS2)
sep = ','; -- set citation separator to its default (comma)
if not is_set (ps) then -- if |postscript= has not been set, set cs2 default
ps = ''; -- make sure it isn't nil
end
if not is_set (ref) then -- if |ref= is not set
ref = "harv"; -- set default |ref=harv
end
else -- not a citation template so CS1
sep = '.'; -- set cite xxx separator to its default (period)
if not is_set (ps) then -- if |postscript= has not been set
ps = '.'; -- set cs1 default
end
end
 
return sep, ps, ref -- return them all
end
 
--[[--------------------------< S E T _ S T Y L E >------------------------------------------------------------
 
Establish basic style settings to be used when rendering the citation. Uses |mode= if set and valid or uses
config.CitationClass from the template's #invoke: to establish style.
 
]]
 
function set_style (mode, ps, ref, cite_class)
local sep;
if is_set (mode) then
if 'cs2' == mode then -- if this template is to be rendered in CS2 (citation) style
sep = ','; -- separate elements with a comma
if not is_set (ps) then -- unless explicitely set to something
ps = ''; -- make sure it isn't nil
end
if not is_set (ref) then -- unless explicitely set to something
ref = 'harv'; -- set so this template renders with CITEREF anchor id
end
elseif 'cs1' == mode then -- if this template is to be rendered in CS1 (cite xxx) style
sep = '.'; -- separate elements with a period
if not is_set (ps) then -- unless explicitely set to something
ps = '.'; -- terminate the rendered citation with a period
end
else -- anything but cs1 or cs2
table.insert( z.message_tail, { seterror( 'invalid_param_val', {'mode', mode}, true ) } ); -- add error message
sep, ps, ref = get_settings_from_cite_class (ps, ref, cite_class); -- get settings based on the template's CitationClass
end
else -- when |mode= empty or omitted
sep, ps, ref = get_settings_from_cite_class (ps, ref, cite_class); -- get settings based on the template's CitationClass
end
if 'none' == ps:lower() then -- if assigned value is 'none' then
ps = ''; -- set to empty string
end
return sep, ps, ref
end
 
 
வரி 1,540 ⟶ 1,637:
local Editors = A['Editors'];
local e = extractnames( args, 'EditorList' );
 
local NameListFormat = A['NameListFormat']; -- replaces |author-format= and |editor-format=
if is_set (NameListFormat) and ('vanc' ~= NameListFormat) then -- only accepted value for this parameter is 'vanc'
table.insert( z.message_tail, { seterror( 'invalid_param_val', {'name-list-format', NameListFormat}, true ) } ); -- not vanc so add error message
NameListFormat = ''; -- set to empty string
end
 
local Year = A['Year'];
வரி 1,592 ⟶ 1,695:
local Format = A['Format'];
local ChapterFormat = A['ChapterFormat'];
local Ref = A['Ref'];
local DoiBroken = A['DoiBroken'];
local ID = A['ID'];
வரி 1,602 ⟶ 1,704:
 
local Quote = A['Quote'];
local PostScript = A['PostScript'];
 
local LayURL = A['LayURL'];
வரி 1,609 ⟶ 1,710:
local TranscriptURL = A['TranscriptURL']
local TranscriptURLorigin = A:ORIGIN('TranscriptURL'); -- get name of parameter that holds TranscriptURL
local sepc = A['Separator'];
 
local LastAuthorAmp = A['LastAuthorAmp'];
வரி 1,625 ⟶ 1,725:
local COinS_date; -- used in the COinS metadata
 
-- set default parameter values defined by |mode= parameter. If |mode= is empty or omitted, use CitationClass to set these values
-- Set postscript default.
local sepc; -- separator between citation elements for CS1 a period, for CS2, a comma
if not is_set (PostScript) then -- if |postscript= has not been set (Postscript is nil which is the default for {{citation}}) and
local PostScript;
if (config.CitationClass ~= "citation") then -- this template is not a citation template
local Ref;
PostScript = '.'; -- must be a cite xxx template so set postscript to default (period)
sepc, PostScript, Ref = set_style (A['Mode']:lower(), A['PostScript'], A['Ref'], config.CitationClass);
end
use_lowercase = ( sepc == ',' ); -- used to control capitalization for certain static text
else
if PostScript:lower() == 'none' then -- if |postscript=none then
PostScript = ''; -- no postscript
end
end
 
--check this page to see if it is in one of the namespaces that cs1 is not supposed to add to the error categories.
வரி 1,675 ⟶ 1,771:
 
All other combinations of |encyclopedia, |title, and |article are not modified
TODO: script-title to script-chapter if and when we support script-chapter
]]
 
if ( config.CitationClass == "encyclopaedia" ) then
local Encyclopedia = A['Encyclopedia'];
 
if ( config.CitationClass == "encyclopaedia" ) or ( config.CitationClass == "citation" and is_set (Encyclopedia)) then -- test code for citation
if is_set(Periodical) then -- Periodical is set when |encyclopedia is set
if is_set(Title) then
வரி 1,684 ⟶ 1,784:
ChapterURL = URL;
Title = Periodical;
ChapterFormat = Format;
Periodical = ''; -- redundant so unset
TransTitle = ''; -- redundant so unset
URL = ''; -- redundant so unset
Format = ''; -- redundant so unset
end
else -- |title not set
வரி 1,693 ⟶ 1,795:
end
end
end
 
--special cases for citation.
if (config.CitationClass == "citation") then -- for citation templates
if not is_set (Ref) then -- if |ref= is not set
Ref = "harv"; -- set default |ref=harv
end
if not is_set (sepc) then -- if |separator= is not set
sepc = ','; -- set citation separator to its default (comma)
end
else -- not a citation template
if not is_set (sepc) then -- if |separator= has not been set
sepc = '.'; -- set cite xxx separator to its default (period)
end
end
use_lowercase = ( sepc ~= '.' ); -- used to control capitalization for certain static text
 
-- check for special case where |separator=none
if 'none' == sepc:lower() then -- if |separator=none
sepc = ''; -- then set it to an empty string
end
 
வரி 1,757 ⟶ 1,839:
Others = '(Interview)';
end
end
 
-- special case for cite mailing list
if (config.CitationClass == "mailinglist") then
Periodical = A ['MailingList'];
end
 
வரி 1,768 ⟶ 1,855:
 
-- Account for the oddity that is {{cite conference}}, before generation of COinS data.
--TODO: if this is only for {{cite 'conference}}, shouldn't we be checking? (if== config.CitationClass=='conference' then ...)
if is_set(BookTitle) then
Chapter = Title;
-- ChapterLink = TitleLink; -- |chapterlink= is deprecated
TransChapter ChapterURL = TransTitleURL;
ChapterURLorigin = URLorigin;
Title = BookTitle;
TitleLink URLorigin = '';
TransTitle ChapterFormat = ''Format;
TransChapter = TransTitle;
Title = BookTitle;
Format = '';
-- TitleLink = '';
TransTitle = '';
URL = '';
end
else
Conference = ''; -- not cite conference so make sure this is empty string
end
 
வரி 1,844 ⟶ 1,940:
 
-- At this point fields may be nil if they weren't specified in the template use. We can use that fact.
-- Test if citation has no title
if not is_set(Title) and
-- not is_set(Periodical) and -- not a title
-- not is_set(Conference) and -- not a title
not is_set(TransTitle) and
not is_set(ScriptTitle) then
table.insert( z.message_tail, { seterror( 'citation_missing_title', {}, true ) } );
end
if 'none' == Title and is_set(Periodical) and not (( config.CitationClass == "encyclopaedia" ) or ( config.CitationClass == "citation" and is_set (Encyclopedia))) then -- special case
Title = ''; -- set title to empty string
table.insert( z.maintenance_cats, "CS1 maint: Untitled periodical"); -- add to maint category
end
 
-- COinS metadata (see <http://ocoins.info/>) for automated parsing of citation information.
-- handle the oddity that is cite encyclopedia and {{citation |encyclopedia=something}}. Here we presume that
-- automated parsing of citation information.
-- when Periodical, Title, and Chapter are all set, then Periodical is the book (encyclopedia) title, Title
-- is the article title, and Chapter is a section within the article. So, we remap
local coins_chapter = Chapter; -- default assuming that remapping not required
local coins_title = Title; -- et tu
if 'encyclopaedia' == config.CitationClass or ('citation' == config.CitationClass and is_set (Encyclopedia)) then
if is_set (Chapter) and is_set (Title) and is_set (Periodical) then -- if all are used then
coins_chapter = Title; -- remap
coins_title = Periodical;
end
end
-- this is the function call to COinS()
local OCinSoutput = COinS{
['Periodical'] = Periodical,
['Chapter'] = strip_apostrophe_markup (Chaptercoins_chapter), -- Chapter stripped of bold / italic wikimarkup
['Title'] = make_coins_title (Titlecoins_title, ScriptTitle), -- Title and ScriptTitle stripped of bold / italic wikimarkup
['PublicationPlace'] = PublicationPlace,
['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?
வரி 1,876 ⟶ 1,997:
]]
 
-- special case for cite newsgroup. Do this after COinS because we are modifying Publishername to include somsome static text
if 'newsgroup' == config.CitationClass then
if is_set (PublisherName) then
வரி 1,900 ⟶ 2,021:
 
local control = {
format = NameListFormat, -- empty string or 'vanc'
sep = A["AuthorSeparator"] .. " ",
namesep = (first_set(A["AuthorNameSeparator"], A["NameSeparator"]) or "") .. " ",
format = A["AuthorFormat"],
maximum = Maximum,
lastauthoramp = LastAuthorAmp,
வரி 1,933 ⟶ 2,052:
 
local control = {
format = NameListFormat, -- empty string or 'vanc'
sep = A["EditorSeparator"] .. " ",
namesep = (first_set(A["EditorNameSeparator"], A["NameSeparator"]) or "") .. " ",
format = A['EditorFormat'],
maximum = Maximum,
lastauthoramp = LastAuthorAmp,
வரி 1,967 ⟶ 2,084:
if not is_set(URL) and
not is_set(ArchiveURL) and
not is_set(ConferenceURL) and -- TODO: keep this here? conference as part of cite web or cite podcast?
not is_set(TranscriptURL) then
-- Test if cite web or cite podcast |url= is missing or empty
if inArray(config.CitationClass, {"web","podcast", "mailinglist"}) then
table.insert( z.message_tail, { seterror( 'cite_web_url', {}, true ) } );
end
வரி 1,986 ⟶ 2,103:
end
end
--[[
 
-- Test if citation has no title
if not is_set(Title) and
-- not is_set(Periodical) and -- not a title
-- not is_set(Conference) and -- not a title
not is_set(TransTitle) and
not is_set(ScriptTitle) then
வரி 1,996 ⟶ 2,113:
end
if 'none' == Title and is_set(Periodical) then -- special case
 
Title = ''; -- set title to empty string
table.insert( z.maintenance_cats, "CS1 maint: Untitled periodical"); -- add to maint category
end
]]
local OriginalURL;
DeadURL = DeadURL:lower(); -- used later when assembling archived text
வரி 2,015 ⟶ 2,136:
end
 
if inArray(config.CitationClass, {"web","news","journal","pressrelease","conference","podcast", "newsgroup"}) or ('citation' == config.CitationClass and is_set (Periodical)) then
('citation' == config.CitationClass and is_set (Periodical) and not is_set (Encyclopedia)) then
if is_set (Chapter) or is_set (TransChapter) or is_set (ChapterURL)then -- chapter parameters not supported for these citation types
if is_set (Chapter) or is_set (TransChapter) or is_set (ChapterURL)then -- chapter parameters not supported for these citation types
table.insert( z.message_tail, { seterror( 'chapter_ignored', {}, true ) } ); -- add error message
table.insert( z.message_tail, { seterror( 'chapter_ignored', {}, true ) } ); -- add error message
Chapter = ''; -- set to empty string to be safe with concatenation
Chapter = ''; -- set to empty string to be safe with concatenation
TransChapter = '';
ChapterURL TransChapter = '';
ChapterURL = '';
end
end
else -- otherwise, format chapter / article title
Chapter = format_chapter_title (Chapter, TransChapter, ChapterURL, ChapterURLorigin);
வரி 2,038 ⟶ 2,160:
end
 
if inArray(config.CitationClass, {"web","news","journal","pressrelease","conferencepodcast", "podcastnewsgroup", "newsgroupmailinglist"}) or ('citation' == config.CitationClass and is_set (Periodical)) then
('citation' == config.CitationClass and is_set (Periodical) and not is_set (Encyclopedia)) then
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from Module provided quote marks
Title = kern_quotes (Title); -- if necessary, separate title's leading and trailing quote marks from Module provided quote marks
Title = wrap_style ('quoted-title', Title);
Title = wrap_style ('quoted-title', Title);
 
Title = script_concatenate (Title, ScriptTitle); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle );
elseif 'report' == config.CitationClass then -- no styling for cite report
Title = script_concatenate (Title, ScriptTitle); -- <bdi> tags, lang atribute, categorization, etc; must be done after title is wrapped
TransTitle= wrap_style ('trans-quoted-title', TransTitle ); -- for cite report, use this form for trans-title
else
Title = wrap_style ('italic-title', Title);
வரி 2,161 ⟶ 2,287:
-- handle type parameter for those CS1 citations that have default values
 
if inArray(config.CitationClass, {"AV-media-notes", "DVD-notes", "mailinglist", "podcast", "pressrelease", "report", "techreport", "thesis"}) then
TitleType = set_titletype (config.CitationClass, TitleType);
if is_set(Degree) and "Thesis" == TitleType then -- special case for cite thesis
வரி 2,196 ⟶ 2,322:
 
]]
if is_setinArray(SubscriptionRequired:lower(), {'yes', 'true', 'y'}) then
SubscriptionRequired = sepc .. " " .. cfg.messages['subscription']; -- subscription required message
elseif is_setinArray(RegistrationRequired:lower(), {'yes', 'true', 'y'}) then
SubscriptionRequired = sepc .. " " .. cfg.messages['registration']; -- registration required message
else
SubscriptionRequired = ''; -- either or both might be set to something other than yes true y
end
 
வரி 2,215 ⟶ 2,343:
if "thesis" == config.CitationClass and is_set(Docket) then
ID = sepc .." Docket ".. Docket .. ID;
end
if "report" == config.CitationClass and is_set(Docket) then -- for cite report when |docket= is set
ID = sepc .. ' ' .. Docket; -- overwrite ID even if |id= is set
end
 
வரி 2,371 ⟶ 2,502:
if is_set(Authors) then
if is_set(Coauthors) then
local sep = '; ';
Authors = Authors .. A['AuthorSeparator'] .. " " .. Coauthors
if 'vanc' == NameListFormat then
sep = ', ';
end
Authors = Authors .. sep .. Coauthors;
end
if is_set(Date) then
வரி 2,466 ⟶ 2,601:
end
end
names[ #names + 1 ] = first_set(Year, anchor_year); -- Year first for legacy citations and for YMD dates that require disambiguation
id = anchorid(names)
end
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது