Module:ko/multi
පෙනුම
- මෙම module සතුව උපදෙස් උප පිටුවක් නොපවතියි. Please නිර්මාණය කරන්න.
- ප්රයෝජනවත් සබැඳි: root page • root page’s subpages • සබැඳි • transclusions • testcases • sandbox
local export = {}
local m_template_parser = require("Module:template parser")
local class_else_type = m_template_parser.class_else_type
local ko_link = require("Module:ko").link
local parse = m_template_parser.parse
local pcall = pcall
function export.main(frame)
local text = frame:getParent().args["data"]
if not text then
return ""
end
text = parse(frame:getParent().args["data"])
for node, parent, key in text:iterate_nodes() do
local class = class_else_type(node)
if class ~= "wikitext" then
local new
if class == "template" and node:get_name() == "ko-l" then
local success, result = pcall(ko_link, node:get_arguments(), lang)
if success then
new = result
end
end
if not new then
new = node:expand()
end
if parent then
parent[key] = new
else
text = new
end
end
end
return tostring(text)
end
return export