Editing Module:Param Parse
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 66: | Line 66: | ||
function parse.image_name(img) |
function parse.image_name(img) |
||
if img then |
if img then |
||
return string.match(img, '%[%[ |
return string.match(img, '%[%[File:(.+%.%w%w%w)|?%d*x?%d*p?x?%]%]') |
||
end |
end |
||
return nil |
return nil |
||
Line 78: | Line 78: | ||
function parse.image_width(img, default) |
function parse.image_width(img, default) |
||
if img then |
if img then |
||
return string.match(img, ' |
return string.match(img, '[%[File:.+%.%w%w%w|(%d*)x?%d*px%]%]') or default |
||
end |
end |
||
return default |
return default |
||
Line 94: | Line 94: | ||
size = '|x'..height..'px' |
size = '|x'..height..'px' |
||
end |
end |
||
if |
if img then |
||
return '[['..name..size..']]' |
return '[['..name..size..']]' |
||
end |
end |