From f2b88f03ce30c1e02e87f469bce92d019b09e81f Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Wed, 28 Jun 2023 16:20:17 +0100 Subject: [PATCH] tools/2xep.lua: emit instead of XEPs don't use . --- tools/2xep.lua | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tools/2xep.lua b/tools/2xep.lua index 83a06b3f..4a6e0b95 100644 --- a/tools/2xep.lua +++ b/tools/2xep.lua @@ -95,8 +95,11 @@ function Doc(body, metadata, variables) local first, last = sv:match("(%S+)%s+(%S+)"); -- Names are hard add(("%s"):format(first)); add(("%s"):format(last)); - -- Why is there HTML in the thing? - for typ, addr in sv:gmatch("%shref='(%a+):([^']+)") do + -- The values have already be converted to the output format. + -- This means author entries with e.g. will already + -- have been converted into by the + -- Link() function. Hence this hacky parser to get back the original info. + for typ, addr in sv:gmatch("%surl='(%a+):([^']+)") do if typ == "mailto" then add(("%s"):format(addr)); elseif typ == "xmpp" then @@ -180,8 +183,7 @@ function Strikeout(s) end function Link(s, src, tit, attr) - return "" .. s .. "" + return "" .. s .. "" end function Image(s, src, tit, attr)