Modul:Labelled list hatnote: Unterschied zwischen den Versionen
Fixed iteration-and-removal bug
(Updated from sandbox: preserve input/output ordering) |
(Fixed iteration-and-removal bug) |
||
Zeile 90: | Zeile 90: | ||
function p._labelledList (pages, labels, options) | function p._labelledList (pages, labels, options) | ||
if options.ifexists then | if options.ifexists then | ||
for k, v | for k = #pages, 1, -1 do --iterate backwards to allow smooth removals | ||
local v = pages[k] | |||
local title = mw.title.new(getTarget(v), namespace) | local title = mw.title.new(getTarget(v), namespace) | ||
if (v == '') or title == nil or not title.exists then | if (v == '') or title == nil or not title.exists then |