Module:Section link and Module:Section link/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
imported>Trappist the monk
sync from sandbox;
 
imported>Dan Leonard
 
Line 84: Line 84:
-- conjunction. There is also a special case conjunction if we only
-- conjunction. There is also a special case conjunction if we only
-- have two links.
-- have two links.
local conjunction
local conjunction_string
local conjunction_word = 'and'
if options.conjunction and options.conjunction ~= '' then
conjunction_word = options.conjunction
end
if #sections == 2 then
if #sections == 2 then
conjunction = '​ and '
conjunction_string = ' ' .. conjunction_word .. ' '
else
else
conjunction = ', and '
conjunction_string = ', ' .. conjunction_word .. ' '
end
end
ret = mw.text.listToText(ret, nil, conjunction)
ret = mw.text.listToText(ret, nil, conjunction_string)


-- Add the intro text.
-- Add the intro text.