diff mod_conversejs/mod_conversejs.lua @ 3333:5be90562e14b

mod_conversejs: Allow custom tags to be inserted into the generated HTML
author Matthew Wild <mwild1@gmail.com>
date Thu, 27 Sep 2018 11:55:35 +0100
parents 4fdd8b77da54
children b46bb9392efe
line wrap: on
line diff
--- a/mod_conversejs/mod_conversejs.lua	Thu Sep 27 11:55:07 2018 +0100
+++ b/mod_conversejs/mod_conversejs.lua	Thu Sep 27 11:55:35 2018 +0100
@@ -76,6 +76,16 @@
 	return converse_options;
 end
 
+local add_tags = module:get_option_set("conversejs_tags");
+
+if add_tags then
+	local tags = {};
+	for tag in add_tags do
+		table.insert(tags, tag);
+	end
+	html_template = html_template:gsub("</head>", table.concat(tags, "\n"):gsub("%%", "%%").."\n</head>");
+end
+
 module:provides("http", {
 	route = {
 		GET = function (event)