Module:Template:attention

Frae Wikipedia, the free beuk o knawledge
local p = {}

function p.main(frame)
	if frame.args[1] == 'html_encode' then
		return p.html_encode(frame.args[2])
	else
		error('Unrecognized command')
	end
end

function p.html_encode(s)
	return (s:gsub('[<>"\']', function (c)
		return '&#' .. c:byte() .. ';'
	end))
end

return p