Content deleted Content added
update from sandbox per Template talk:Convert#Module version 17 |
update from sandbox per Template talk:Convert#Module version 19 |
||
Line 277:
end
local function input_from_text(tdata, parms, text, insert2)
-- Given string should be of form "<value><space><unit>"
-- "<value1><space>ft<space><value2><space>in" for a special case (feet and inches).
-- Return
text = text:gsub(' ', ' '):gsub('
local pos = text:find(' ', 1, true)
if pos then
Line 286 ⟶ 287:
local value = text:sub(1, pos - 1)
local uid = text:sub(pos + 1)
if uid:sub(1, 3) == 'ft ' and uid:sub(-3) == ' in' then
local ucode = make_unit(tdata.wikidata_units, parms, uid)▼
-- Special case for enwiki to allow {{convert|input=5 ft 10+1/2 in}}
insert2(uid:sub(4, -4), 'in')
insert2(value, 'ft')
else
end
return true
end
end
Line 310 ⟶ 317:
return false, pid and { 'cvt_no_output' } or { 'cvt_bad_input', text }
end
local function
table.insert(parms, index, second)
table.insert(parms, index, first)
Line 331 ⟶ 338:
local item = ucode
for i = result.n, 1, -1 do
item = sep
end
return true
else
return true
end
|