function p.testcase(frame)
local args = frame:getParent().args
local basepagename = mw.ustring.gsub(mw.title.getCurrentTitle().text, '/.*$', '');rootText
local template1args['_template1'] = args['_template1'] or (basepagename)
local template2args['_template2'] = args['_template2'] or (basepagename .. '/sandbox')
local heading1args['_heading1'] = args['_heading1'] or '{{[[Template:' .. template1args['_template1'] .. '|' .. template1args['_template1'] ..']]}}'
local heading2args['_heading2'] = args['_heading2'] or '{{[[Template:' .. template2args['_template2'] .. '|' .. template2args['_template2'] ..']]}}'
local captionargs['_caption'] = args['_caption'] or 'Side by side comparison'
local t = {}
local res1 = frame:expandTemplate{ title = template1args['_template1'], args = targs } ▼
for k, v in pairs(args) do
local res2 = frame:expandTemplate{ title = template2args['_template2'], args = targs } ▼
return mw.ustring.format( [==[
▲ local res1 = frame:expandTemplate{ title = template1, args = t }
return '<table><caption> ' .. caption .. '%s</caption> \n' ..▼
▲ local res2 = frame:expandTemplate{ title = template2, args = t }
'<tr><th style="width:50 %%"> ' .. heading1 .. '%s</th><th style="width:50 %%"> ' .. heading2 .. '%s</tr> \n' ..▼
<tr style="vertical-align:top"><td>
▲ return '<table><caption>' .. caption .. '</caption>\n' ..
%s</td><td>
▲ '<tr><th style="width:50%">' .. heading1 .. '</th><th style="width:50%">' .. heading2 .. '</tr>\n' ..
%s</td></tr></table>]==],
'<tr style="vertical-align:top"><td>\n' .. res1 .. '</td><td>\n' .. res2 .. '</td></tr></table>'
args['_caption'],
args['_heading1'], args['_heading2'],
res2
end
|