Jump to content

Module:Emoji

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Trappist the monk (talk | contribs) at 12:42, 25 March 2019. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

local p= {}
local emodata = mw.loadData ('Module:Emoji/data')

function p.emocode(frame)
	local emotbl = emodata.emotbl
	local emoname = frame.args[1] and mw.text.trim(frame.args[1])
	if '' == emoname then
		emoname = 'smiley';
	end
	return emotbl[emoname] or emoname
end

function p.emoname(frame)
	local emorevtbl = emodata.emorevtbl
	local emocode = frame.args[1] and mw.text.trim(frame.args[1])
	if '' == emocode then
		emocode = '1f603';
	end
	return emorevtbl[emocode] or emocode
end

return p