Changeset

1432:ee2302b78c74

mod_latex: get_child_text!
author Kim Alvefur <zash@zash.se>
date Wed, 11 Jun 2014 20:38:07 +0200
parents 1431:33a796b2cb91
children 1433:df8da7e4c2bf
files mod_latex/mod_latex.lua
diffstat 1 files changed, 2 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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