Module:Block value: Difference between revisions
No edit summary |
Just the parens should be removed, not the contents |
||
| Line 5: | Line 5: | ||
args = f:getParent().args | args = f:getParent().args | ||
end | end | ||
local block = ( args[1] or | local block = ( args[1] or '' ):lower() | ||
-- Most of these transforms are unnecessary, but are kept for compatibility with original template | -- Most of these transforms are unnecessary, but are kept for compatibility with original template | ||
| Line 22: | Line 22: | ||
block = block:gsub( 's$', '' ) | block = block:gsub( 's$', '' ) | ||
end | end | ||
-- Other transforms | -- Other transforms | ||
| Line 31: | Line 28: | ||
:gsub( 'mossy', 'moss' ) | :gsub( 'mossy', 'moss' ) | ||
:gsub( 'steps', 'stairs' ) | :gsub( 'steps', 'stairs' ) | ||
:gsub( "['%-]", '' ) | :gsub( "['%(%)%-%s]+", '' ) | ||
local value = mw.loadData( [[Module:Hardness values]] )[block] | local value = mw.loadData( [[Module:Hardness values]] )[block] | ||