Module:Template link general: Difference between revisions

From the Croc Wiki, the Croc encyclopedia
Jump to navigationJump to search
implement sandbox changes - now with "show code output" option (FPER)
m (1 revision imported from meta:Module:Template_link_general)
(implement sandbox changes - now with "show code output" option (FPER))
Line 90:
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
local code = _ne(args.code) or _ne(args.tt)
local show_result = _ne(args._show_result)
-- Build the link part
Line 99 ⟶ 100:
local textPart = ""
local textPartBuffer = ""
local codeArguments = {}
local i = 2
while args[i] do
Line 108 ⟶ 110:
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
val = nw(mw.text.unstripNoWiki(val))
end
local k, v = string.match(val, "(.*)=(.*)")
if not k then
codeArguments[i] = val
else
codeArguments[k] = v
end
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
Line 133 ⟶ 141:
--]]
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
if show_result then
local result = mw.getCurrentFrame():expandTemplate{title = "Template:" .. args[1], args = codeArguments}
ret = ret .. " → " .. result
end
return ret
end
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.

Navigation menu