Module:Ul

From Constructed Worlds Wiki
Jump to navigation Jump to search
This article uses material from an existing source, which is released under the Creative Commons Attribution-ShareAlike 3.0 Unported License.

local getArgs = require('Module:Arguments').getArgs

local p = {}

function p.main(frame)
  local args = getArgs(frame)
  local class = args['class']
  local style = args['style']
  local ul = mw.html.create('ul')
  if class ~= nil then
    ul:addClass(class)
  end
  if class ~= nil then
    ul:cssText(style)
  end
  for _, v in ipairs(args) do
    if v then ul:tag('li'):wikitext(v) end
  end
  return tostring(ul)
end

return p