Module:Block value: Difference between revisions

Created page with "local p = {} p.hardness = function( f ) local args = f if f == mw.getCurrentFrame() then args = f:getParent().args end local block = args[1]:gsub( '%s+', '' ):lower()..."
 
No edit summary
Line 24: Line 24:
-- Remove stuff in parens
-- Remove stuff in parens
block = block:gsub( '%([^%)]+%)', '' )
block = block:gsub( '%s*%([^%)]+%)', '' )
-- Other transforms
-- Other transforms
Line 33: Line 33:
:gsub( "['%-]", '' )
:gsub( "['%-]", '' )
local value = mw.loadData( 'Module:Hardness values' )[block]
local value = mw.loadData( [[Module:Hardness values]] )[block]
local category = ''
local category = ''
if not value then
if not value then