Jump to content

Module:Citation/CS1: Difference between revisions

plural option for editors
m>Dragons flight
(oops)
m>Dragons flight
(plural option for editors)
Line 136: Line 136:
         end
         end
     end
     end
    local count = #text;
     local result = table.concat(text, sep) -- construct list
     local result = table.concat(text, sep) -- construct list
     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
     return result, count
end
end


Line 493: Line 494:
         Authors = listpeople(control, a)  
         Authors = listpeople(control, a)  
     end
     end
    local EditorCount
     if ( Editors == nil ) then  
     if ( Editors == nil ) then  
         local EditorNameSep = args["editor-name-separator"] or args["name-separator"] or "&#44; "
         local EditorNameSep = args["editor-name-separator"] or args["name-separator"] or "&#44; "
Line 499: Line 501:
         local EditorMaximum = tonumber(args["display-editors"] or args.displayeditors) or 3
         local EditorMaximum = tonumber(args["display-editors"] or args.displayeditors) or 3
         local control = { sep = EditorSep, namesep = EditorNameSep, format = EditorFormat, maximum = EditorMaximum }
         local control = { sep = EditorSep, namesep = EditorNameSep, format = EditorFormat, maximum = EditorMaximum }
         Editors = listpeople(control, e)  
         Editors, EditorCount = listpeople(control, e)  
    else
        EditorCount = 1;
     end
     end
     if ( Date == nil or Date == "") then
     if ( Date == nil or Date == "") then
Line 837: Line 841:
     elseif ( "" ~= Editors) then
     elseif ( "" ~= Editors) then
         if ( "" ~= Date ) then
         if ( "" ~= Date ) then
             Editors = Editors .. ", ed."
             if EditorCount <= 1 then
                Editors = Editors .. ", ed."
            else
                Editors = Editors .. ", eds."
            end               
             Date = " (" .. Date ..")" .. OrigYear .. sepc .. " "
             Date = " (" .. Date ..")" .. OrigYear .. sepc .. " "
         else
         else
             Editors = Editors .. " (ed.)" .. sepc .. " "
             if EditorCount <= 1 then
                Editors = Editors .. " (ed.)" .. sepc .. " "
            else
                Editors = Editors .. " (eds.)" .. sepc .. " "
            end               
         end
         end
         text = Editors .. Date .. Chapter .. tcommon .. Issue .. Page .. Pages .. At .. idcommon
         text = Editors .. Date .. Chapter .. tcommon .. Issue .. Page .. Pages .. At .. idcommon
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.