Module:Excerpt slideshow/sandbox: Difference between revisions

Content deleted Content added
Undid revision 1113585997 by Sumanuil (talk) - Its not broken, im doing active testing on Module:Excerpt/portals/sandbox in relation to something else. Sorry if the formats broken a bit on any testcases. I'll likely revert to a stable version soon
Avoid turning | into {{!}} due to fear of processing errors - gallery is quite robust and Random slideshow now provides a much more logical response
Line 88:
end
)
end
 
local replacePipesWithMagicword = function(t)
return mw.ustring.gsub(t, '|', '{{!}}')
end
 
Line 115 ⟶ 111:
end
-- else replace pipes and remove internal linebreaks
return replacePipesWithMagicword(mw.ustring.gsub(t, '\n*', ''))
end
 
Line 123 ⟶ 119:
-- strip tables and block templates; strip newlines and replace pipes within inline templates
excerpt = mw.ustring.gsub(excerpt..'\n', '\n?%b{}\n?', processBraces)
-- replace pipes within links
excerpt = mw.ustring.gsub(excerpt, '%b[]', replacePipesWithMagicword)
-- replace other pipes with html entity
excerpt = mw.ustring.gsub(excerpt, '|', '|')
-- replace wikitext bulleted lists with html bulleted lists
excerpt = gsubWikitextLists(excerpt, '*', 'ul', 'li')
Line 156 ⟶ 148:
excerpt = excerpt .. " ('''[[" .. title .. "|" .. options.more .. "]]''')"
end
local text = '<div style{{=}}"text-align:left;">' .. mw.ustring.gsub(excerpt, '%c', '<br>') .. '</div>'
table.insert(galleryArgs, 'File:Blank.png')
table.insert(galleryArgs, text)