Module:Consecutive links: Difference between revisions

fixed consecutive links bug
(big refactor, shouldn't break anything?)
(fixed consecutive links bug)
Line 25: Line 25:


if type == 'links' then
if type == 'links' then
   returnstrformat = function(linkprefix, word, linkpostfix)
   returnstrformat = function(prefix, word, postfix)
     return '[[' .. linkprefix .. word .. linkpostfix .. ']]'
     return prefix .. '[['.. word .. ']]' .. postfix
     end
     end
elseif type == 'templates' then
elseif type == 'templates' then
Line 39: Line 39:
     returnstr = returnstr .. replacer  
     returnstr = returnstr .. replacer  
   end
   end
   returnstr = returnstr .. returnstrformat(linkprefix, word, linkpostfix)
   returnstr = returnstr .. returnstrformat(prefix, word, postfix)
end
end
return returnstr
return returnstr
Line 54: Line 54:


function p.test(frame)
function p.test(frame)
   return p.parse({'Joppa,Grit Gate,Bey Lah', nil, nil, nil, nil, 'favilink', nil}, 'templates')
   str = '{{SkillID to name|Axe}} </br>{{SkillID to name|Axe_Expertise}}'
  separator = '</br>'
  replacer = '</div><div class{{=}}"qud-skill-entry">'
local prefix ='<div class{{=}}"qud-skill-entry">'
local postfix = '</div>'
  args = {str, separator, replacer, prefix, postfix}
  return p.parse(args, 'links')
end
end
return p
return p