Modulo:InfoboxImage: Malsamoj inter versioj

[kontrolita revizio][kontrolita revizio]
Enhavo forigita Enhavo aldonita
e la funkcio "i.GetCaption" ankoraŭ faras problemojn ekz. en Ŝablono:Distrikto Rottweil. tial mi forigas ĝian enplekton. mi ankoraŭ devos cerbumi pri ŝanĝo de la funkcio. eble mi ja trovos trukon.
aldono
Linio 266:
local center = frame.args["center"]
local placeholder = frame.args["suppressplaceholder"]
local caption = frame.args["caption"] or ""
local wd = frame.args["wd"] or ""
-- test, if there are more than one image in a string, for example if the code is from Wikidata
local strings = ""
local n = 1
iflocal imagecap ~= "" and image ~= nil then
local ncap = 1
-- only use this code, if the image comes from Wikidata
if image ~= "" and image ~= nil and wd == "yes" then
strings = mw.text.split(image, ",", plain)
n = #strings -- number of images
cap = mw.text.split(caption,"/#/", plain)
ncap = #cap
end
if n>1 then
local images = ""
for k,v in pairs(strings) do
if n < ncap then
images = images .. i._InfoboxImage(v, ending, endingdefault, size, maxsize, sizedefault, alt, link, title, border, upright, thumbtime, center, usecaption, placeholder)
ncap = ""
end
local cap1 = cap[k]
if cap1 ~= "" then
cap1 = "<div>" .. cap1 .. "</div>"
end
images = images .. i._InfoboxImage(v, ending, endingdefault, size, maxsize, sizedefault, alt, link, title, border, upright, thumbtime, center, usecaption, placeholder, cap1)
end
return images
end
return i._InfoboxImage(image, ending, endingdefault, size, maxsize, sizedefault, alt, link, title, border, upright, thumbtime, center, usecaption, placeholder, caption)
 
end
-- function for other modules
function i._InfoboxImage(image, ending, endingdefault, size, maxsize, sizedefault, alt, link, title, border, upright, thumbtime, center, usecaption, placeholder, caption)
if image == "" or image == nil then
return "";
Linio 324 ⟶ 338:
return image .. "[[Kategorio:Paĝoj uzantaj informkestojn kun etaj bildoj]]";
else
return image .. caption;
end
elseif mw.ustring.sub(image,1,2) == "{{" and mw.ustring.sub(image,1,3) ~= "{{{" then