mod_latex/mod_latex.lua
changeset 1433 df8da7e4c2bf
parent 1432 ee2302b78c74
equal deleted inserted replaced
1432:ee2302b78c74 1433:df8da7e4c2bf
     3 
     3 
     4 local xmlns_xhtmlim = "http://jabber.org/protocol/xhtml-im";
     4 local xmlns_xhtmlim = "http://jabber.org/protocol/xhtml-im";
     5 local xmlns_xhtml = "http://www.w3.org/1999/xhtml";
     5 local xmlns_xhtml = "http://www.w3.org/1999/xhtml";
     6 
     6 
     7 local function replace_latex(data)
     7 local function replace_latex(data)
     8 	module:log("debug", "Replacing latex...");
       
     9 	local origin, stanza = data.origin, data.stanza;
     8 	local origin, stanza = data.origin, data.stanza;
    10 	local body = stanza:get_child_text("body");
     9 	local body = stanza:get_child_text("body");
    11 	if not body or not body:match("%$%$") then
    10 	if not body or not body:match("%$%$") then
    12 		return;
    11 		return;
    13 	end
    12 	end
       
    13 	module:log("debug", "Replacing latex...");
    14 
    14 
    15 	local html = st.stanza("html", { xmlns = xmlns_xhtmlim })
    15 	local html = st.stanza("html", { xmlns = xmlns_xhtmlim })
    16 		:tag("body", { xmlns = xmlns_xhtml });
    16 		:tag("body", { xmlns = xmlns_xhtml });
    17 
    17 
    18 	local in_latex, last_char;
    18 	local in_latex, last_char;