440
edits
(Now it works as before unless _notcollapsed has a value) |
m (87 revisions imported from wikipedia:Module:Template_test_case) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 94:
function Template:getFullPage()
if not self.template then
return self.title.prefixedText▼
elseif self.template:sub(1, 7) == '#invoke' then
return 'Module' .. self.template:sub(8):gsub('|.*', '')
else▼
local strippedTemplate, hasColon = self.template:gsub('^:', '', 1)
hasColon = hasColon > 0
Line 106 ⟶ 110:
return mw.site.namespaces[10].name .. ':' .. strippedTemplate
end
▲ else
▲ return self.title.prefixedText
end
end
Line 348 ⟶ 350:
root
:addClass('mw-collapsible')
if self.options.notcollapsed == false then
root
:addClass('mw-collapsed')
Line 743 ⟶ 745:
function TableInvocation:getOutput(options)
if (options.template:sub(1, 7) == '#invoke') then
local moduleCall = mw.text.split(options.template, '|', true)
local args = mw.clone(self.invokeArgs)
table.insert(args, 1, moduleCall[2])
return mw.getCurrentFrame():callParserFunction(moduleCall[1], args)
end
return mw.getCurrentFrame():expandTemplate{
title = options.template,
|