Jump to content

Module:Template test case: Difference between revisions

use a bulleted list for the inline format because grr bug 14974
(add TestCase:renderInline and add newlines between the render output when making collapsible test cases)
(use a bulleted list for the inline format because grr bug 14974)
Line 377: Line 377:
function TestCase:renderInline()
function TestCase:renderInline()
local arrow = mw.language.getContentLanguage():getArrow('forwards')
local arrow = mw.language.getContentLanguage():getArrow('forwards')
local ret = {}
local list = mw.html.create('ul')
list
:addClass(self.options.class)
:cssText(self.options.style)
for i, obj in ipairs(self.templates) do
for i, obj in ipairs(self.templates) do
local line = {}
local line = {}
line[#line + 1] = ': '
if self.options.showcode then
if self.options.showcode then
line[#line + 1] = obj:getInvocation('code')
line[#line + 1] = obj:getInvocation('code')
Line 388: Line 390:
end
end
line[#line + 1] = self:getTemplateOutput(obj)
line[#line + 1] = self:getTemplateOutput(obj)
ret[#ret + 1] = table.concat(line)
list
:tag('li')
:newline()
:wikitext(table.concat(line))
end
end
return table.concat(ret, '\n')
return table.concat(ret, '\n')
Cookies help us deliver our services. By using our services, you agree to our use of cookies.