Changes

no edit summary
Line 51: Line 51:  
if(idsList) then
 
if(idsList) then
 
for j, qid in ipairs(idsList) do
 
for j, qid in ipairs(idsList) do
if(q.label == qid) then
+
for k, label in ipairs(mw.text.split(q.label,',')) do
proceed = true
+
if(label == qid) then
table.remove(idsList, j)
+
proceed = true
break
+
table.remove(idsList, j)
 +
break
 +
end
 
end
 
end
 +
if proceed then break end
 
end
 
end
 
end
 
end
Line 71: Line 74:  
end
 
end
 
table.insert(result, frame:expandTemplate{title='ProtoQuests', args={
 
table.insert(result, frame:expandTemplate{title='ProtoQuests', args={
type = q.type or mapLetterType[q.label:sub(1,1)],
+
type = q.type or mapLetterType[q.letter or q.label:sub(1,1)],
listnum = q.label,
+
listnum = q.label:gsub(',','<br>'),
 
reqQuest = reqQuests[1],
 
reqQuest = reqQuests[1],
 
reqQuest2 = reqQuests[2],
 
reqQuest2 = reqQuests[2],
Line 92: Line 95:  
end
 
end
 
local s = _.join(result, '\n')
 
local s = _.join(result, '\n')
s = s:gsub("{{([^|]+)|([^}]+)}}", function (template,argStr)
+
return frame:preprocess(s)
local args = {}
  −
for i,part in ipairs(mw.text.split(argStr,'|')) do
  −
if part:find('=') then
  −
a = mw.text.split(part,'=')
  −
args[a[1]] = a[2]
  −
else
  −
table.insert(args, part)
  −
end
  −
end
  −
return frame:expandTemplate{title=template, args=args}
  −
end)
  −
return s
   
end
 
end
  
5,401

edits