--- a/mod_latex/mod_latex.lua Wed Jun 11 12:50:57 2014 +0200
+++ b/mod_latex/mod_latex.lua Wed Jun 11 20:38:07 2014 +0200
@@ -7,11 +7,8 @@
local function replace_latex(data)
module:log("debug", "Replacing latex...");
local origin, stanza = data.origin, data.stanza;
- local body = stanza:child_with_name("body");
- if not body then return; end
-
- body = body:get_text();
- if not body:match("%$%$") then
+ local body = stanza:get_child_text("body");
+ if not body or not body:match("%$%$") then
return;
end