Editing Module:UtilitiesGive feedback
Jump to navigation
Jump to search
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
| Latest revision | Your text | ||
| Line 51: | Line 51: | ||
-- If the image exists exists, return it back enclosed in brackets, else return a blank string | -- If the image exists exists, return it back enclosed in brackets, else return a blank string | ||
function p.get_image_file(image_file_name, px | function p.get_image_file(image_file_name, px) | ||
if (px == nil) then px = 15 end --default | if (px == nil) then px = 15 end --default | ||
image_file = mw.title.new(image_file_name) | image_file = mw.title.new(image_file_name) | ||
if image_file and image_file.exists then | if image_file and image_file.exists then | ||
image_file_name = "[[" .. image_file_name .. "|" .. px .. "px | image_file_name = "[[" .. image_file_name .. "|" .. px .. "px]]" | ||
else | else | ||
image_file_name = '' | image_file_name = '' | ||