Content deleted Content added
fix |
expand any templates in the caption |
||
Line 64:
function extractRegularFiles(wikitext)
local files = {}
local frame = mw.getCurrentFrame()
local expand = function(template)
return frame:preprocess(template)
end
local wikitext = mw.ustring.gsub(wikitext, '|thumb', '')
for file in mw.ustring.gmatch(wikitext, '%b[]' ) do
Line 71 ⟶ 75:
file = mw.ustring.gsub(file, '|%s*center%s*([|%]])', '%1')
file = mw.ustring.gsub(file, '|%s*upright%s*=?%s*.-([|%]])', '%1')
file = mw.ustring.gsub(file, '{%b{}}', expand)
file = mw.ustring.gsub(file, '|', '{{!}}')
file = mw.ustring.gsub(file, '^%[%[', '')
|