Module:Random slideshow/sandbox: Difference between revisions

Content deleted Content added
explain removal problem
Improve the alt= movement situation by adding a (somewhat inefficient but safe) check
Line 40:
local sortedLines = nonRandom and galleryLines or randomModule.main('array', randomiseArgs)
for i = 1, #sortedLines do
-- move the alt parameter to the end of the file should it exist to fix linter errors
--[=[ This code is causing problems with piped wikilinks
-- movemake sure the alt parameter toisnt theperhaps endbeing ofconfused theby filea shouldwikilink inside it exist
sortedLines[i]local altParam = sortedLines[i]:gsub(
"^(.+)(%{%{!}}alt%{%{=}}[^{]*)(.*)$",
"%1%3%2")
if not string.find(altParam,"%[%[") then
--]=]
sortedLines[i] = sortedLines[i]:gsub(
"^(.+)(%{%{!}}alt%{%{=}}[^{]*)(.*)$",
"%1%3%2")
end
-- insert a switcher-label span just after the first pipe (which has already been escaped as {{!}} instead the | character)
sortedLines[i] = sortedLines[i]:gsub(