Module:Template test case and Module:Template test case/sandbox: Difference between pages

(Difference between pages)
Jump to navigation Jump to search
Page 1
Page 2
(Added support for _titlecodeifnotitle parameter)
 
(Create sandbox version of Module:Template test case)
 
Line 339: Line 339:
return true
return true
end
end
-- PoEWiki customization: '_titlecodeifnotitle' uses the invocation text as the title only if no _title is specified


function TestCase:makeCollapsible(s)
function TestCase:makeCollapsible(s)
local invocationtext = self.templates[1]:getInvocation('kbd')
local title = self.options.title or self.templates[1]:makeHeader()
if (self.options.titlecodeifnotitle) then
if self.options.titlecode then
title = self.options.title or invocationtext
title = self.templates[1]:getInvocation('kbd')
elseif (self.options.titlecode) then
title = invocationtext
else
title = self.options.title or self.templates[1]:makeHeader()
end
end
local isEqual = self:templateOutputIsEqual()
local isEqual = self:templateOutputIsEqual()