"ഘടകം:Zh" എന്ന താളിന്റെ പതിപ്പുകൾ തമ്മിലുള്ള വ്യത്യാസം

Content deleted Content added
try another thing; construct params in one go
Change var so it doesn't conflict with field in param block, hopefully to fix spans
വരി 102:
 
-- go through all possible fields in loop, adding them to the output
for i, namepart in ipairs(orderlist) do
if (args[namepart]) then
local val = args[namepart]
if (val ~= "") then
if (ISOlang[namepart]) then -- add language if needed
params = {["lang"] = ISOlang[namepart], ["xml:lang"] = ISOlang[namepart]}
val = mw.text.tag({name="span",attr=params, content=val})
elseif (namepart == "p") then -- italicise pinyin
val = "''" .. val .. "''"
elseif (namepart == "l") then -- put literals in quotes
val = '"' .. val .. '"'
end
-- if has associated category add it
if (cats[namepart]) then
val = val .. cats[namepart]
end
-- build this entry
if (no) or name == "l" then
body = body .. labels[namepart] .. ": " .. val .. "; "
else
body = body .. "[[" .. wlinks[namepart] .. "|" .. labels[namepart] .. "]]: " .. val .. "; "
end
end
"https://ml.wikipedia.org/wiki/ഘടകം:Zh" എന്ന താളിൽനിന്ന് ശേഖരിച്ചത്