Changes
Jump to navigation
Jump to search
Line 90:
Line 90:
+
Line 99:
Line 100:
+
Line 108:
Line 110:
+
+
+
+
+
+
Line 133:
Line 141:
+
+
+
+
+
Module:Template link general (view source)
Revision as of 09:02, 29 January 2022
, 09:02, 29 January 2022bit flip per previous
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
local textPart = ""
local textPart = ""
local textPartBuffer = ""
local textPartBuffer = ""
local codeArguments = {}
local i = 2
local i = 2
while args[i] do
while args[i] do
-- 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
--]]
--]]
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