Difference between revisions of "Module:Test"

From Industrial-Craft-Wiki
Jump to navigation Jump to search
m (Hmmmmm)
m (Wow, that was careless)
Line 15: Line 15:
       return string.match(args[1], '.+#%d+.+')
       return string.match(args[1], '.+#%d+.+')
   else
   else
       return args[1].sub(1, -1)
       return string.sub(args[1], 2, -1)
   end
   end
    
    

Revision as of 11:08, 18 February 2015

Documentation for this module may be created at Module:Test/doc

local p = {}

function p.rss( f )
   local args = f
 
   if f == mw.getCurrentFrame() then
      args = f:getParent().args
   end

   --return "<nowiki>" .. (args[1] or "") .. "</nowiki>"
   if args[1] == nil then
      return "Nothing :S"
   end
   if(args[1]:find("#")) then
      return string.match(args[1], '.+#%d+.+')
   else
      return string.sub(args[1], 2, -1)
   end
   
end

return p