function p:namecall()
return self
end
function p.pipeProcessingAbsurdityTest(frame)
-- To do with [[Module:Random slideshow]]
-- I need this to somehow expand the tags with the input having pipes
-- Since if we remove pipes and use {{1}}, advanced wikitext causes linter errors and terrible display failures
-- {{#tag:gallery|' .. galleryContent .. '|mode=slideshow|class=switcher-container}}
local inputUnpiped = [==[File:MH-60S Helicopter dumps water onto Fire.jpg{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image 1</span></span>Water is used for [[fire fighting{{!}}fighting]] [[wildfire]]s. (from '''[[Water]]''')
File:Water molecule (1).svg{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image 2</span></span>A water molecule consists of two hydrogen atoms and one oxygen atom (from '''[[Water]]''')
File:Water withdrawals per capita, OWID.svg{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image 3</span></span>Total water withdrawals for agricultural, industrial and municipal purposes per capita, measured in cubic metres (m³) per year in 2010 (from '''[[Water]]''')
File:Icosahedron-spinoza.jpg{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image 4</span></span>[[Icosahedron]] as a part of [[Baruch Spinoza{{!}}Spinoza]] monument in [[Amsterdam]]. (from '''[[Water]]'''){{!}}alt{{=}}Icosahedron as a part of Spinoza monument in Amsterdam.
File:Sterilewater.jpg{{!}}<span class="switcher-label" style="display:none"><span class="randomSlideshow-sr-only">Image 5</span></span>Sterile water for injection (from '''[[Water]]''')]==]
-- just the first five images given out by galleryContent in Random slideshow.makeOutput()
local inputPiped = string.gsub(inputUnpiped,"{{!}}","|")
local results = {}
results[#results+1] = frame:preprocess("{{#tag:gallery|" .. inputUnpiped .. "|mode=slideshow|class=switcher-container}}")
-- results[#results+1] = frame:preprocess("{{#tag:gallery|" .. inputPiped .. "|mode=slideshow|class=switcher-container}}")
-- results[#results+1] = frame:preprocess(string.gsub(inputPiped,"\n","\n\n"))
-- results[#results+1] = frame:preprocess("{{#invoke:Text|concatParams|" .. inputPiped .. "}}")
-- results[#results+1] = frame:preprocess("{{#tag:gallery|{{#invoke:Text|concatParams|" .. inputPiped .. "}}|mode=slideshow|class=switcher-container}}")
-- results[#results+1] = frame:extensionTag({name="gallery",content=inputPiped,args={mode="slideshow",class="switcher-container"}})
results[#results+1] = '<gallery mode="slideshow" class="switcher-container">' .. inputUnpiped .. '</gallery>'
results[#results+1] = '<gallery mode="slideshow" class="switcher-container">' .. inputPiped .. '</gallery>'
results[#results+1] = frame:preprocess('<gallery mode="slideshow" class="switcher-container">' .. inputUnpiped .. '</gallery>')
results[#results+1] = frame:preprocess('<gallery mode="slideshow" class="switcher-container">' .. inputPiped .. '</gallery>')
for a,b in next,results do
mw.log("result",a,":",b)
end
return table.concat(results,"\n\n<hr>\n\n")
end
|