Module:Template test case: Difference between revisions

    (allow _template to override _template1 for backwards compatibility with Module:Testcase table)
    (use wikitext bulleted lists for the inline format after all)
    Line 386: Line 386:
    function TestCase:renderInline()
    function TestCase:renderInline()
    local arrow = mw.language.getContentLanguage():getArrow('forwards')
    local arrow = mw.language.getContentLanguage():getArrow('forwards')
    local list = mw.html.create('ul')
    local ret = {}
    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 399: Line 397:
    end
    end
    line[#line + 1] = self:getTemplateOutput(obj)
    line[#line + 1] = self:getTemplateOutput(obj)
    list
    ret[#ret + 1] = table.concat(line)
    :tag('li')
    :newline()
    :wikitext(table.concat(line))
    end
    end
    return tostring(list)
    return table.concat(ret)
    end
    end