Module:Wd: Difference between revisions

Content deleted Content added
Another Wikidata bug in geo coordinates has been fixed
Fixed bug where calls to any function without any arguments caused an infinite loop
Line 840:
 
function Config:processFlag(flag)
if not flag then
return false
else
flag = mw.text.trim(flag)
end
if flag == "linked" then
self.curState.linked = true
Line 880 ⟶ 886:
function Config:processFlagOrCommand(flag)
local param = ""
if not flag then
return false
else
flag = mw.text.trim(flag)
end
if flag == "property" or flag == "properties" then
Line 1,376 ⟶ 1,388:
local hooks = {count = 0}
local nextArg = mw.text.trim(args[1] or "")
local nextIndex = 2
-- process flags and commands
while _:processFlagOrCommand(nextArg) do
nextArg = mw.text.trim(args[nextIndex] or "")
nextIndex = nextIndex + 1
end
if nextArg then
nextArg = mw.text.trim(nextArg)
else
nextArg = ""
end
Line 1,527 ⟶ 1,545:
local title = nil
local nextArg = mw.text.trim(args[1] or "")
local nextIndex = 2
while _:processFlag(nextArg) do
nextArg = mw.text.trim(args[nextIndex] or "")
nextIndex = nextIndex + 1
end
if nextArg then
nextArg = mw.text.trim(nextArg)
else
nextArg = ""
end