Module:Random slideshow/sandbox: Difference between revisions

Content deleted Content added
close the outer span
cleanup
Line 4:
local randomModule = require('Module:Random')
local redirectModule = require('Module:Redirect')
 
local MAX_IMAGES_FOR_MOBILE = 200
 
function cleanupArgs(argsTable)
Line 41 ⟶ 39:
local sortedLines = nonRandom and galleryLines or randomModule.main('array', randomiseArgs)
for i = 1, #sortedLines do
-- insert a switcher-label span just after the first pipe (which has already been escaped as {{!}} instead the | character)
if i < MAX_IMAGES_FOR_MOBILE then
sortedLines[i] = sortedLines[i]:gsub(
"%{%{%!%}%}",
'{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image ' .. tostring(i) .. '</span></span>', 1)
end 1)
end
local galleryContent = table.concat(sortedLines, '\n')