Jump to content

Module:Sandbox/Wqnvlz/Preprocess ISO 3166 data

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wqnvlz (talk | contribs) at 21:50, 31 March 2022 (Bake Module:ISO 3166 preprocessing). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)
local getArgs = require('Module:Arguments').getArgs
local strip = require('Module:ISO 3166/sandbox').strip

local t = getArgs()[1]

local result = {}
local inside = false
local i = 1
for block in mw.text.gsplit(t, '"', true) do
	result[i] = inside and strip(block) or block
	inside = not inside
	i = i + 1
end

return unpack(result)