Changes

Jump to navigation Jump to search
bit flip per previous
Line 90: Line 90:  
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
 
local dontBrace = _ne(args.brace) or _ne(args.braceinside)
 
local code = _ne(args.code) or _ne(args.tt)
 
local code = _ne(args.code) or _ne(args.tt)
 +
local show_result = _ne(args._show_result)
 
 
 
-- Build the link part
 
-- Build the link part
Line 99: Line 100:  
local textPart = ""
 
local textPart = ""
 
local textPartBuffer = ""
 
local textPartBuffer = ""
 +
local codeArguments = {}
 
local i = 2
 
local i = 2
 
while args[i] do
 
while args[i] do
Line 108: Line 110:  
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
 
-- mangle the nowiki strip marker and result in literal UNIQ...QINU showing up
 
val = nw(mw.text.unstripNoWiki(val))
 
val = nw(mw.text.unstripNoWiki(val))
 +
end
 +
local k, v = string.match(val, "(.*)=(.*)")
 +
if not k then
 +
codeArguments[i - 1] = val
 +
else
 +
codeArguments[k] = v
 
end
 
end
 
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
 
if italic then val = '<span style="font-style:italic;">' .. val .. '</span>' end
Line 133: Line 141:  
--]]
 
--]]
 
if _ne(args.debug) then ret = ret .. '\n<pre>' .. mw.text.encode(mw.dumpObject(args)) .. '</pre>' end
 
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
 
return ret
 
end
 
end
    
return p
 
return p
Anonymous user

Navigation menu