Module:InfoboxImage: Difference between revisions

From Roses, Tulips, & Liberty
Content added Content deleted
(https exceptions)
(tidy sub code as per talk page)
Line 52: Line 52:
-- remove file: or image: prefix if exists
-- remove file: or image: prefix if exists
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
image = mw.ustring.sub(image,6,mw.ustring.len(image));
image = mw.ustring.sub(image,6);
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
image = mw.ustring.sub(image,7,mw.ustring.len(image));
image = mw.ustring.sub(image,7);
end
end
-- Trim spaces
-- Trim spaces
Line 128: Line 128:
-- remove file: or image: prefix if exists
-- remove file: or image: prefix if exists
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
if mw.ustring.lower(mw.ustring.sub(image,1,5)) == "file:" then
image = mw.ustring.sub(image,6,mw.ustring.len(image));
image = mw.ustring.sub(image,6);
end
end
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
if mw.ustring.lower(mw.ustring.sub(image,1,6)) == "image:" then
image = mw.ustring.sub(image,7,mw.ustring.len(image));
image = mw.ustring.sub(image,7);
end
end