Editing Module:Demo
From MINR.ORG WIKI
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 42: | Line 42: | ||
return { | return { | ||
source = noWiki or code, | source = noWiki or code, | ||
− | output = orphan:preprocess(code | + | output = orphan:preprocess(code), |
frame = frame | frame = frame | ||
} | } | ||
Line 48: | Line 48: | ||
function p.main(frame, demoTable) | function p.main(frame, demoTable) | ||
− | local show = demoTable or p.get(frame) | + | local demo_args = (frame:getParent() or frame).args |
+ | local show = demoTable or p.get(frame, demo_args.pass_nowiki or frame.args.pass_nowiki, demo_args.passArgs or frame.args.passArgs) | ||
local args = show.frame.args | local args = show.frame.args | ||
args.br = tonumber(args.br or 1) and ('<br>'):rep(args.br or 1) or args.br or '' | args.br = tonumber(args.br or 1) and ('<br>'):rep(args.br or 1) or args.br or '' | ||
Line 65: | Line 66: | ||
'demo_main', | 'demo_main', | ||
'demo_br', | 'demo_br', | ||
− | 'demo_result_arg | + | 'demo_result_arg' |
− | |||
}) | }) | ||
local template = frame.args.demo_template and 'Template:'..frame.args.demo_template | local template = frame.args.demo_template and 'Template:'..frame.args.demo_template | ||
Line 97: | Line 97: | ||
return p.main(orphan, { | return p.main(orphan, { | ||
source = mw.text.encode(table.concat(source), "<>'|=~"), | source = mw.text.encode(table.concat(source), "<>'|=~"), | ||
− | output = tostring(demoModule(orphan) | + | output = tostring(demoModule(orphan)), |
frame = frame | frame = frame | ||
}) | }) |