Module:linkeach: Difference between revisions

From Linguifex
Jump to navigation Jump to search
No edit summary
No edit summary
Line 7: Line 7:
for word in mw.ustring.gmatch(str, "(%S+)") do
for word in mw.ustring.gmatch(str, "(%S+)") do
word = "[[Contionary:" .. word .. "|" .. word .. "]]"
word = "[[Contionary:" .. mw.ustring.lower(word) .. "|" .. word .. "]]"
table.insert(words, word)
table.insert(words, word)
end
end

Revision as of 15:06, 19 February 2021



local export = {}

function export.link(frame)
	
	local args = frame.args
	local str = args[1]; local words = {}
	
	for word in mw.ustring.gmatch(str, "(%S+)") do
		word = "[[Contionary:" .. mw.ustring.lower(word) .. "|" .. word .. "]]"
		table.insert(words, word)
	end
	
	return table.concat(words, " ")
end
return export