Content deleted Content added
%1 |
require transcluded images to have captions |
||
Line 57:
end
return galleryLinesTable
end
function hasCaption(line)
local caption = mw.ustring.match(line, ".-{{!}}(.*)")
-- require caption to exist with more than 5 characters (avoids sizes etc being mistaken for captions)
return caption and #caption>5 and true or false
end
Line 140 ⟶ 146:
if galleryFiles then
for _, f in pairs(galleryFiles) do
if hasCaption(f) then
local filename = string.gsub(f, '{{!}}.*', '') local isOkay = excerptModule.checkimage(filename)
if isOkay then
table.insert(lines, f)
end
end
end
Line 151 ⟶ 159:
if otherFiles then
for _, f in pairs(extractRegularFiles(otherFiles)) do
if f and f ~= '' and mw.ustring.sub(f, 1, 5) == 'File:' and hasCaption(f) then
table.insert(lines, f)
end
|