17,273
edits
(allow display names that differ from page names) |
(be a tiny bit smarter finding the caption (last item, unless it's 'right')) |
||
Line 15: | Line 15: | ||
local fileParts = mw.text.split( file, '|' ) | local fileParts = mw.text.split( file, '|' ) | ||
local fileName = fileParts[1] | local fileName = fileParts[1] | ||
local fileCaption = fileParts[ | local fileCaption = fileParts[#fileParts] ~= 'right' and fileParts[#fileParts] -- TODO need to be smarter about this. for now, assuming the last item is either 'right' or the caption | ||
gallery:addFile( fileName or 'No Image.png', '[[' .. (link or section.name) .. '|' .. (fileCaption or section.name) .. ']]', { | gallery:addFile( fileName or 'No Image.png', '[[' .. (link or section.name) .. '|' .. (fileCaption or section.name) .. ']]', { | ||
link = section.name, | link = section.name, |