Content deleted Content added
mNo edit summary |
Fixed issue with -0 value; changed movable separator default under certain condition |
||
Line 150:
end
-- used to merge output
-- note that it currently mutates the first input
function
for i = 1, #
end
return
end
Line 231:
if i then
-- year
parts[index] = tonumber(mw.ustring.gsub(dateStr:sub(ptr, i-1), "^\+(.+)$", "%1"), 10) -- remove '+' sign (explicitly give base 10 to prevent error)
if parts[index] == -0 then
parts[index] = tonumber("0") -- for some reason, 'parts[index] = 0' may actually store '-0', so parse from string instead
end
Line 526:
sorted = ranks[1]
sorted =
sorted =
return sorted
Line 817:
if numDigits < 0 or numDigits == -0 then
numDigits = tonumber("0") -- for some reason, 'numDigits = 0' may actually store '-0', so parse from string instead
end
Line 1,200:
for i, v in ipairs(formatTable) do
if v.param then
valuesArray =
else
valuesArray[#valuesArray + 1] = {v.str}
Line 1,206:
if v.child then
valuesArray =
end
end
Line 1,230:
if #valuesArray > 0 then
valuesArray[#valuesArray + 1] = {sep}
out =
end
end
Line 1,297:
end
out =
end
end
Line 1,628:
if args["format"] then
parsedFormat, formatParams = parseFormat(mw.text.trim(args["format"]))
elseif _.states.qualifiersCount > 0 then -- "qualifier(s)" command given
if _.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.propertyWithQualifier)
else
parsedFormat, formatParams = parseFormat(formats.qualifier)
end
elseif _.states[parameters.property] then -- "propert(y|ies)" command given
parsedFormat, formatParams = parseFormat(formats.property)
else -- "reference(s)" command given
parsedFormat, formatParams = parseFormat(formats.reference)
-- if only "reference(s)" has been given, make the emtpy string the default separator (except when raw)▼
-- if a "qualifier(s)" command and no "propert(y|ies)" command has been given, make the movable separator a semicolon
if not _.states[parameters.reference].rawValue then▼
if _.states.qualifiersCount > 0 and not _.states[parameters.property] then
_.separators["sep"][1] = ""▼
_.separators["sep"..parameters.separator][1] = ";"
▲ end
end
▲
if _.states[parameters.reference] and not _.states[parameters.property] and _.states.qualifiersCount == 0
end
|