Module:linkeach: Difference between revisions

no edit summary
No edit summary
No edit summary
 
(5 intermediate revisions by the same user not shown)
Line 13: Line 13:
return table.concat(words, sep)
return table.concat(words, sep)
end
function export.link_for_modules(str)
local words = {}
for word in mw.ustring.gmatch(str, "(%S+)") do
word = "[[" .. mw.ustring.lower(word) .. "|" .. word .. "]]"
table.insert(words, word)
end
return table.concat(words, " ")
end
end


Line 24: Line 36:
if mw.title.new(word, 'Contionary').exists == true then
if mw.title.new(word, 'Contionary').exists == true then
word = "[[Contionary:" .. mw.ustring.lower(word) .. "|" .. word .. "]]"
word = "[[Contionary:" .. mw.ustring.lower(word) .. "|" .. word .. "]]"
table.insert(words, word)
else
table.insert(words, word)
table.insert(words, word)
end
end