Jump to content

Module:Citation/CS1: Difference between revisions

get the semicolon off the et al.
m>Dragons flight
(DOI cleanup is organized by year)
m>Dragons flight
(get the semicolon off the et al.)
Line 125: Line 125:
     local maximum = control.maximum
     local maximum = control.maximum
     local text = {}
     local text = {}
    local etal = false;
     for i,person in ipairs(people) do
     for i,person in ipairs(people) do
         if (person.last ~= nil or person.last ~= "") then
         if (person.last ~= nil or person.last ~= "") then
Line 130: Line 131:
             local one
             local one
             if ( maximum ~= nil and i == maximum + 1 ) then
             if ( maximum ~= nil and i == maximum + 1 ) then
                 local etal_text = "et al."
                 etal = true;
                if (sepc == ".") then etal_text = "et al" end
                 break;
                one = etal_text
            elseif ( maximum ~= nil and i > maximum + 1 ) then
                 break
             elseif (mask ~= nil) then
             elseif (mask ~= nil) then
                 local n = tonumber(mask)
                 local n = tonumber(mask)
Line 156: Line 154:
     local count = #text;
     local count = #text;
     local result = table.concat(text, sep) -- construct list
     local result = table.concat(text, sep) -- construct list
    if etal then
        local etal_text = "et al."
        if (sepc == ".") then etal_text = "et al" end
        result = result .. " " .. etal_text;
    end
   
     if ( "scap" == format ) then result= z.mw.text.tag({name="span", contents=result, params={class="smallcaps", style="font-variant:small-caps;"}}) end -- if necessary wrap result in <span> tag to format in Small Caps
     if ( "scap" == format ) then result= z.mw.text.tag({name="span", contents=result, params={class="smallcaps", style="font-variant:small-caps;"}}) end -- if necessary wrap result in <span> tag to format in Small Caps
     return result, count
     return result, count
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.