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

உள்ளடக்கம் நீக்கப்பட்டது உள்ளடக்கம் சேர்க்கப்பட்டது
remove Module:Wikitext requirement no longer used here, and remove parts of createTag no longer needed
merge from sandbox. Removes unused functions (moved to Module:Citation) and updates page handling
வரிசை 20:
['&'] = '&',
["'"] = ''',
['['] = '[',
[']'] = ']',
['{'] = '{',
வரிசை 140:
 
function hyphentodash( str )
if str == nil then
return nil;
end
return str:gsub( '-', '–' );
end
வரி 302 ⟶ 305:
end
 
function refid(args)
local p = args.p or ""
local pp = args.pp or ""
local loc = args.loc or ""
return anchorid(args) .. p .. pp .. loc
end
 
function name(args)
local P1 = args[1] or ""
if ( args[5] ~= nil) then
return P1 .. " et al."
else
local P2 = args[2] or ""
local P3 = args[3] or ""
local P4 = args[4] or ""
if ( args[4] ~= nil ) then
P4 = " " .. P4
P3 = ", & " .. P3
P2 = ", " .. P2
elseif ( args[3] ~= nil ) then
P3 = " " .. P3
P2 = " & " .. P2
elseif ( args[2] ~= nil ) then
P2 = " " .. P2
end
return P1 .. P2 .. P3 .. P4
end
end
 
function crossref(frame, args)
local config = frame.args -- the arguments passed BY the template, in the wikitext of the template itself
local LB = config.BracketLeft or ""
local RB = config.BracketRight or ""
local anchor = args.ref or args.Ref or anchorid(args)
local text = name(args)
local loc = args.loc
local page
local pages = args.pp or args.pages
if pages == nil or pages == '' then
page = args.p or args.page;
end
if nil == loc then loc = "" else loc = " " .. loc end
if ( page ~= nil ) then
local pagesep = config.PageSep or ", p. "
loc = loc .. pagesep .. page
end
if ( pages ~= nil ) then
local pagessep = config.PagesSep or ", pp. "
loc = loc .. pagessep .. pages
end
local pagename = args.pagename or ""
local ps = args.Postscript or ""
return LB .. "[[" .. pagename .. "#" .. anchor .. "|" .. text .. "]]" .. loc .. RB .. ps
end
function extractauthors(args)
local authors = {};
வரி 477 ⟶ 425:
local Issue = args.issue or args.number
local Position = nil
local Page = args.p or args.page
local Pages = hyphentodash( args.pp or args.pages )
if Pages == nil or Pages == '' then
Page = args.page -- allows Pages to override Page
else
Pages = hyphentodash( Pages );
end
 
local PP = args.pp
local At = args.at
local page_error = false;
if Page ~= nil and Page ~= '' then
if (Pages ~= nil and Pages ~= '') or (At ~= nil and At ~= '') then
Pages = nil;
At = nil;
page_error = true;
end
elseif Pages ~= nil and Pages ~= '' then
if At ~= nil and At ~= '' then
At = nil;
page_error = true;
end
end
local PP = args.pp
local Edition = args.edition
local PublicationPlace = args["publication-place"] or args.publicationplace or args.place or args.location
வரி 792 ⟶ 749:
if ( nil == Page or "" == Page ) then
Page = ""
elseif ( Periodical ~= nilif and( Periodicalnil ~== Pages or "" and== Pages) then
Pages config.CitationClass ~= "encyclopaedia" and
elseif ( Periodical ~= nil and config.CitationClassPeriodical ~= "web" and
config.CitationClass ~= "bookencyclopaedia" and
config.CitationClass ~= "newsweb") thenand
Page = ": " config..CitationClass ~= "book" Pageand
config.CitationClass ~= "news") then
Pages = ": " .. Pages
else
if ( tonumber(Pages) ~= nil ) then
Pages = sepc .." " .. PPrefix .. Pages
else Pages = sepc .." " .. PPPrefix .. Pages
end
end
else
PagePages = sepc .." " .. PPrefix .. Page
if ( Periodical ~= nil and Periodical ~= "" and
end
if ( nil == Pages or "" == Pages) then
Pages = ""
elseif ( Periodical ~= nil and Periodical ~= "" and
config.CitationClass ~= "encyclopaedia" and
config.CitationClass ~= "web" and
config.CitationClass ~= "book" and
config.CitationClass ~= "news") then
Pages Page = ": " .. PagesPage
else
if ( tonumber(Pages) ~ Page = nilsepc .." " .. PPrefix ).. thenPage
Pages = sepc .." " .. PPrefix .. Pages
else Pages = sepc .." " .. PPPrefix .. Pages
end
end
வரி 1,008 ⟶ 968:
local text
local pgtext = Page .. Pages .. At
if page_error then
pgtext = pgtext .. '[[Category:References with multiple page specifications]]<!-- Bad page specification here -->';
end
if ( "" ~= Authors ) then
if (Coauthors ~= "")
வரி 1,224 ⟶ 1,188:
--14Mar2013 Fixed double-dot before "p." or "pp." page number.
--14Mar2013 Fixed config.CitationClass "book" to use p./pp. page.
--18Mar2013 Fixed "page=" to override "pages=" as in markup-based cites.
--
--End
"https://tamilar.wiki/w/Module:Citation/CS1" இலிருந்து மீள்விக்கப்பட்டது