Jump to content
Toggle menu
  • 3 articles
  • 75 files
  • 7 users
  • 37.9K edits
Neodyland Wiki
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Igenmod: Difference between revisions

From Neodyland Wiki
m test
m 43 revisions imported
 
(One intermediate revision by one other user not shown)
Line 169: Line 169:
local parind = 0;
local parind = 0;
local argtab = mw.text.split( parstr, "/" ); -- becomes "|"
local argtab = mw.text.split( parstr, "/" ); -- becomes "|"
 
local fpos  = nil;
for i, v in ipairs(argtab) do
for i, v in ipairs(argtab) do
-- if v ~= '' then
-- if v ~= '' then
v = mw.ustring.gsub( v, "¦" , "/" ),_; -- repl brokenbar by slash
v = mw.ustring.gsub( v, "¦" , "/" ); -- repl brokenbar by slash ,_
local fpos = mw.ustring.find( v, '~' ); -- "~" becomes "="
fpos = mw.ustring.find( v, '~' ); -- "~" becomes "="
if fpos == nil then
if fpos == nil then
if v ~= '+' then
if v ~= '+' then
Line 186: Line 187:
-- end
-- end
end
end
if tmplte ~= 'Igen/coa' then
if mw.ustring.sub (tmplte,1,4) == 'Igen'  then -- Showname
table.insert( outtab, '+' ) -- re_insert the "+"
fpos = mw.ustring.find( outtab [1], ':' ); -- shortcut:
if fpos ~= nil then -- "T;xx:yy" > "T", "s=xx", "w=yy"
outtab['w'] = mw.ustring.sub ( outtab [1], fpos+1 );
outtab[1] = mw.ustring.sub ( outtab [1],1, fpos-1 );
end
fpos = mw.ustring.find( outtab [1], ';' ); -- shortcut:
if fpos ~= nil then -- "Tool;d" > "Tool", "s=d"
outtab['s'] = mw.ustring.sub ( outtab [1], fpos+1 );
outtab[1] = mw.ustring.sub ( outtab [1],1, fpos-1 );
end
-- if mw.ustring.sub (tmplte,5) ~= '/coa' then
table.insert( outtab, '+' ); -- re_insert the "+"
-- end
end
end
return mw.getCurrentFrame(): expandTemplate { title = tmplte, args = outtab };
return mw.getCurrentFrame(): expandTemplate { title = tmplte, args = outtab };
end -- function q_split
end -- function q_split


-- function t_split: 1 parm "templte/p1/p2/.."  
-- function t_split: 1 parm "templte/p1/p2/.."  
Cookies help us deliver our services. By using our services, you agree to our use of cookies.