Jump to content

Module:Sandbox/Gnosygnu

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 68.192.174.14 (talk) at 04:45, 21 January 2016 (matching false). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
--This Module is for Lua experimentation. No other pages refer to it.

local p = {}

function p.link(frame)
  local word = false;

	if not mw.ustring.match(word, "[%[%]]") then
		if mw.ustring.match(word, "^—.+—$") then
			word = mw.ustring.gsub(word, "—(.+)—", "—[[%1]]—")
		else
			word = "[[" .. word .. "]]"
		end
	end
	
  return word;
end

return p