mod_post_msg: Add <body> wrapper tag with namespace in module so the client doesn't have to
authorKim Alvefur <zash@zash.se>
Wed, 28 May 2014 21:20:51 +0200
changeset 1418 a0375f84d65a
parent 1417 9b6fbababb8c
child 1419 877dc87539ff
mod_post_msg: Add <body> wrapper tag with namespace in module so the client doesn't have to
mod_post_msg/mod_post_msg.lua
--- a/mod_post_msg/mod_post_msg.lua	Wed May 28 20:34:57 2014 +0200
+++ b/mod_post_msg/mod_post_msg.lua	Wed May 28 21:20:51 2014 +0200
@@ -50,7 +50,7 @@
 		message = msg({ to = post_body.to or to, from = authed_user,
 		                type = post_body.type or "chat"}, post_body.body);
 		if post_body.html then
-			local html, err = xml.parse(post_body.html);
+			local html, err = xml.parse([[<body xmlns="http://www.w3.org/1999/xhtml">]]..post_body.html..[[</body>]]);
 			if not html then
 				module:log("warn", "mod_post_msg: invalid XML: %s", err);
 				return 400;